From patchwork Mon Feb 4 20:19:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 2095051 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 936DB3FD56 for ; Mon, 4 Feb 2013 20:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754722Ab3BDUTl (ORCPT ); Mon, 4 Feb 2013 15:19:41 -0500 Received: from mail-ie0-f180.google.com ([209.85.223.180]:46602 "EHLO mail-ie0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754500Ab3BDUTl (ORCPT ); Mon, 4 Feb 2013 15:19:41 -0500 Received: by mail-ie0-f180.google.com with SMTP id bn7so5395133ieb.11 for ; Mon, 04 Feb 2013 12:19:41 -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=eJcv0zz4SlkbYACJcOC1CMfC+fwqnkSurI3PFZ7iWHk=; b=LRmeS3+jcrzAzGRTElit9B6dytO86rea6DAp3QvRdpU+wllUJU5372E62jwca3Sv0e b9YVCi+MIIrhflPe0dzUk0b/7JR+BhGUYyIg3ujNPJD27dfYQmnQ2Pk1c8uWpwAadYid 4/uMOQT/aFHjuTLhiTMJ1AWmysISRgWuUf7Jt1mmgs+r8dkMbgGRzGvEiWWl3f/vYHt4 zwbb9LjNscT6Jaj+JlJCwx0GiTK6+8zURcu2h9rXDTcQN51oaJSISk6046tirTspSAqO rHWvCR4tbRiZ+8WkhLRi2mx4cxcbp0HQSMGqagO+Jm5RDPm0QYW9tsZ+Sa1bXiJcTp05 R0Qg== X-Received: by 10.50.36.134 with SMTP id q6mr8807452igj.98.1360009180923; Mon, 04 Feb 2013 12:19:40 -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 br7sm1257218igb.0.2013.02.04.12.19.40 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 04 Feb 2013 12:19:40 -0800 (PST) From: Chuck Lever Subject: [PATCH v3 5/9] SUNRPC: Load GSS kernel module by OID To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Date: Mon, 04 Feb 2013 15:19:39 -0500 Message-ID: <20130204201939.1518.55236.stgit@seurat.1015granger.net> In-Reply-To: <20130204201458.1518.12931.stgit@seurat.1015granger.net> References: <20130204201458.1518.12931.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 ("krb5") or pseudoflavor number ("390003"), but cannot find GSS modules by GSS tuple: [ "1.2.840.113554.1.2.2", GSS_C_QOP_DEFAULT, RPC_GSS_SVC_NONE ] This is important when dealing with a SECINFO request. A SECINFO reply contains a list of flavors the server supports for the requested export, but GSS flavors also have a GSS tuple that maps to a pseudoflavor (like 390003 for krb5). If the GSS module that supports the OID in the tuple is not loaded, our client is not able to load that module dynamically to support that pseudoflavor. Add a way for the GSS mech switch to load GSS pseudoflavor support by OID before searching for the pseudoflavor that matches the OID and service. Signed-off-by: Chuck Lever Cc: David Howells --- 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 61d36ce..b822ec5 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 b09f25b..8d03d32 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(%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) {