All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: "J. Bruce Fields" <bfields@fieldses.org>, Neil Brown <neilb@suse.de>
Cc: linux-nfs@vger.kernel.org, nfsv4@linux-nfs.org
Subject: [PATCH] svcgss: reply AUTH_BADCRED to RPCSEC_GSS with unkown services
Date: Tue, 04 Aug 2009 17:27:52 +0800	[thread overview]
Message-ID: <4A77FF18.4040804@cn.fujitsu.com> (raw)

When RPC messages is received with RPCSEC_GSS, and if the RPCSEC_GSS
include unkown services (not RPC_GSS_SVC_NONE, RPC_GSS_SVC_INTEGRITY
and RPC_GSS_SVC_PRIVACY), the response is considered as AUTH_BADCRED
in svcauth_gss_accept(), but the response be drop by
svcauth_gss_release(). I think response with AUTH_BADCRED is correct
one. So this patch fixed it.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
  static int
  svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
  {
         switch (gc->gc_svc) {
         case RPC_GSS_SVC_NONE:
         ...
         case RPC_GSS_SVC_INTEGRITY:
         ...
         case RPC_GSS_SVC_PRIVACY:
         ...
         default:
                 goto auth_err; <-- reply with AUTH_BADCRED
         }
   ...
   }

  static int
  svcauth_gss_release(struct svc_rqst *rqstp)
  {
      ...
      switch (gc->gc_svc) {
      case RPC_GSS_SVC_NONE:
              break;
      case RPC_GSS_SVC_INTEGRITY:
      ...
      case RPC_GSS_SVC_PRIVACY:
      ...
      default:
             goto out_err; <--- will drop it
      }
      ...
  }
---
 net/sunrpc/auth_gss/svcauth_gss.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 2278a50..6dce327 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1370,7 +1370,7 @@ svcauth_gss_release(struct svc_rqst *rqstp)
 			goto out_err;
 		break;
 	default:
-		goto out_err;
+		goto out;
 	}
 
 out:
-- 
1.6.2.2





             reply	other threads:[~2009-08-04  9:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-04  9:27 Wei Yongjun [this message]
2009-08-25 21:40 ` [PATCH] svcgss: reply AUTH_BADCRED to RPCSEC_GSS with unkown services J. Bruce Fields
2009-08-26  0:34   ` Wei Yongjun
2009-08-26 20:57     ` J. Bruce Fields
2009-08-27  2:23       ` Wei Yongjun
2009-08-27 16:26         ` J. Bruce Fields
2009-08-27 21:05           ` J. Bruce Fields
2009-08-27 21:09             ` J. Bruce Fields
2009-08-28  0:53             ` Wei Yongjun
2009-08-28 16:11               ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A77FF18.4040804@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=nfsv4@linux-nfs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.