From patchwork Mon Jan 28 20:31:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 2058291 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6DBEA3FD49 for ; Mon, 28 Jan 2013 20:32:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753872Ab3A1UcC (ORCPT ); Mon, 28 Jan 2013 15:32:02 -0500 Received: from mail-ia0-f182.google.com ([209.85.210.182]:56688 "EHLO mail-ia0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753531Ab3A1Ub7 (ORCPT ); Mon, 28 Jan 2013 15:31:59 -0500 Received: by mail-ia0-f182.google.com with SMTP id w33so4857673iag.27 for ; Mon, 28 Jan 2013 12:31:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:subject:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=yZnPNmsNtr6CHZYLSNVOCi4SERCLmvNCop5xdurS2FU=; b=qPmjtHsQtHKzyULsEy4WIvFY/uZ8bI9LcXkOhq14wncYxqdze5a0n8Toz0ut+ZAjCu YT9D3n5p/uf/HPNkl+VNIz7efc1ztRfr+PF3huP0eEP44o1mBM3jEZFUk3FhgxUiYZrS VhTiIYwa7jdW5skibSbgy058WNQbWWSusmx3O9cXCOhLAcq6mDJB7HX4NgUqK6kQBvHd SvyeNNkHA96Qdgshf/uXL8Vf/l4Ows1biUy9cgCDvVoELhiFvvc7/J3qSmlJnasu1/1p rqYHKWU9oV6dkMOgvb9qY5EUamyHmAqsYQGmCjRq/HT01IZb2rgLoU4U05qwtJ2Qoo4g j2Vg== X-Received: by 10.50.208.41 with SMTP id mb9mr5977855igc.42.1359405118666; Mon, 28 Jan 2013 12:31:58 -0800 (PST) Received: from seurat.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id dc8sm7602821igb.15.2013.01.28.12.31.57 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 28 Jan 2013 12:31:58 -0800 (PST) From: Chuck Lever Subject: [PATCH 1 4/5] SUNRPC: Find kernel module by OID To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 28 Jan 2013 15:31:57 -0500 Message-ID: <20130128203157.2523.17121.stgit@seurat.1015granger.net> In-Reply-To: <20130128195843.2523.34798.stgit@seurat.1015granger.net> References: <20130128195843.2523.34798.stgit@seurat.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org The current GSS mech switch can find and load GSS pseudoflavor modules by name or pseudoflavor number, but cannot find them by OID. This is important when dealing with a SECINFO request, especially early in the boot process. A SECINFO reply has a list of flavors the server can support, but they are listed by OID. Our client currently can choose only flavors that are already loaded. We want to be able to choose flavors where the module is available but not yet loaded. Add a way for the GSS mech switch to load GSS pseudoflavor support by OID. Signed-off-by: Chuck Lever --- net/sunrpc/Kconfig | 1 + net/sunrpc/auth_gss/gss_krb5_mech.c | 1 + net/sunrpc/auth_gss/gss_mech_switch.c | 7 +++++++ 3 files changed, 9 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig index 03d03e3..f97f555 100644 --- a/net/sunrpc/Kconfig +++ b/net/sunrpc/Kconfig @@ -3,6 +3,7 @@ config SUNRPC config SUNRPC_GSS tristate + select OID_REGISTRY config SUNRPC_BACKCHANNEL bool diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c index d3611f1..8b1005d 100644 --- a/net/sunrpc/auth_gss/gss_krb5_mech.c +++ b/net/sunrpc/auth_gss/gss_krb5_mech.c @@ -750,6 +750,7 @@ MODULE_ALIAS("rpc-auth-gss-krb5p"); MODULE_ALIAS("rpc-auth-gss-390003"); MODULE_ALIAS("rpc-auth-gss-390004"); MODULE_ALIAS("rpc-auth-gss-390005"); +MODULE_ALIAS("rpc-auth-gss-1.2.840.113554.1.2.2"); static struct gss_api_mech gss_kerberos_mech = { .gm_name = "krb5", diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c index 883b5b8..64dbf07a 100644 --- a/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/net/sunrpc/auth_gss/gss_mech_switch.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -174,6 +175,12 @@ EXPORT_SYMBOL_GPL(gss_mech_get_by_name); static struct gss_api_mech *gss_mech_get_by_OID(struct rpcsec_gss_oid *obj) { struct gss_api_mech *pos, *gm = NULL; + char buf[32]; + + if (sprint_oid(obj->data, obj->len, buf, sizeof(buf)) < 0) + return NULL; + dprintk("RPC: %s: oid: %s\n", __func__, buf); + request_module("rpc-auth-gss-%s", buf); spin_lock(®istered_mechs_lock); list_for_each_entry(pos, ®istered_mechs, gm_list) {