nfsd: fix an IS_ERR() vs NULL check
Subsystems (3)
PATCH 1/1 nfsd: fix an IS_ERR() vs NULL check
The get_backchannel_cred() used to return error pointers on error but now it returns NULL pointers.
Fixes 97f68c6b02e0 ("SUNRPC: add 'struct cred *' to auth_cred and rpc_cre")
Signed-off-by Dan Carpenter <[email protected]>
--- fs/nfsd/nfs4callback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/nfs4callback.c +2 -2
@@ -913,9 +913,9 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *creturn PTR_ERR (client); } cred =get_backchannel_cred (clp, client, ses); -if (IS_ERR (cred)) { +if (!cred) {rpc_shutdown_client (client); -return PTR_ERR (cred); +return -ENOMEM ; } clp->cl_cb_client = client; clp->cl_cb_cred = cred;
Signature · 1 line
2.17.1
Quoted 2 lines · Dan Carpenter
The
get_backchannel_cred()used to return error pointers on error but now it returns NULL pointers.
Thanks! Queueing up for 4.21 and stable.
Off the top of my head I don't recall bug reports that could be explained by this. Perhaps it's hard to get a failure at this point without failing somewhere earlier? But I think it's likely possible to trigger a NULL dereference somehow.
--b.
Quoted 25 lines
Fixes 97f68c6b02e0 ("SUNRPC: add 'struct cred *' to auth_cred and rpc_cre")Signed-off-by Dan Carpenter <[email protected]>--- fs/nfsd/nfs4callback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/nfsd/nfs4callback.c +2
-2@@ -913,9 +913,9 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *creturn PTR_ERR (client); } cred =get_backchannel_cred (clp, client, ses); -if (IS_ERR (cred)) { +if (!cred) {rpc_shutdown_client (client); -return PTR_ERR (cred); +return -ENOMEM ; } clp->cl_cb_client = client; clp->cl_cb_cred = cred;Signature · 1 line
2.17.1