Netdev List
 help / color / mirror / Atom feed
From: Syam Sidhardhan <syamsidhardh@gmail.com>
To: linux-nfs@vger.kernel.org, netdev@vger.kernel.org
Cc: davem@davemloft.net, Trond.Myklebust@netapp.com, syamsidhardh@gmail.com
Subject: [PATCH] SUNRPC: Fix possible NULL pointer dereference
Date: Mon, 25 Feb 2013 03:53:25 +0530	[thread overview]
Message-ID: <1361744605-28235-1-git-send-email-s.syam@samsung.com> (raw)

Check for cred == NULL has to be done before accessing cred.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
---
 net/sunrpc/auth.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index f529404..18678a6 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -695,10 +695,13 @@ rpcauth_invalcred(struct rpc_task *task)
 {
 	struct rpc_cred *cred = task->tk_rqstp->rq_cred;
 
+	if (cred == NULL)
+		return;
+
 	dprintk("RPC: %5u invalidating %s cred %p\n",
 		task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
-	if (cred)
-		clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
+
+	clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
 }
 
 int
-- 
1.7.9.5

             reply	other threads:[~2013-02-24 22:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24 22:23 Syam Sidhardhan [this message]
     [not found] ` <1361744605-28235-1-git-send-email-s.syam-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-02-24 22:35   ` [PATCH] SUNRPC: Fix possible NULL pointer dereference Myklebust, Trond
     [not found]     ` <4FA345DA4F4AE44899BD2B03EEEC2FA9235DE4C7-VGJ86jkg8PeBTCzCEi1xmXOR4cbS7gtM96Bgd4bDwmQ@public.gmane.org>
2013-02-25 15:21       ` Syam Sidhardhan

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=1361744605-28235-1-git-send-email-s.syam@samsung.com \
    --to=syamsidhardh@gmail.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=davem@davemloft.net \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox