[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1400190998-28153-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
Date: Thu, 15 May 2014 23:56:38 +0200
From: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
To: "J. Bruce Fields" <bfields@...ldses.org>,
Trond Myklebust <trond.myklebust@...marydata.com>
Cc: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
"David S. Miller" <davem@...emloft.net>, linux-nfs@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] Fix for possible null pointer dereference in auth.c
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
---
net/sunrpc/auth.c | 10 +++++++---
1 fil ändrad, 7 tillägg(+), 3 borttagningar(-)
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 5285ead..3a55698 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -801,10 +801,14 @@ rpcauth_invalcred(struct rpc_task *task)
{
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
- dprintk("RPC: %5u invalidating %s cred %p\n",
- task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
- if (cred)
+ if (cred) {
+ dprintk("RPC: %5u invalidating %s cred %p\n",
+ task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
+
clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
+ }
+ else
+ dprintk("RPC: %5u invalidating is NULL\n", task->tk_pid);
}
int
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists