diff options
author | J. Bruce Fields <bfields@redhat.com> | 2018-12-20 10:35:11 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-26 09:42:51 +0100 |
commit | 84ba6b78ba0e4a9046dc8b9eaeb1e77bf5052bea (patch) | |
tree | 9317e829a4864a693259605f787543f3aa2773bc /net/sunrpc | |
parent | f76e38ea42f5241eb8b0ec49db3197735b44320d (diff) | |
download | linux-stable-84ba6b78ba0e4a9046dc8b9eaeb1e77bf5052bea.tar.gz linux-stable-84ba6b78ba0e4a9046dc8b9eaeb1e77bf5052bea.tar.bz2 linux-stable-84ba6b78ba0e4a9046dc8b9eaeb1e77bf5052bea.zip |
sunrpc: handle ENOMEM in rpcb_getport_async
commit 81c88b18de1f11f70c97f28ced8d642c00bb3955 upstream.
If we ignore the error we'll hit a null dereference a little later.
Reported-by: syzbot+4b98281f2401ab849f4b@syzkaller.appspotmail.com
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index cf5770d8f49a..c89626b2afff 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -772,6 +772,12 @@ void rpcb_getport_async(struct rpc_task *task) case RPCBVERS_3: map->r_netid = xprt->address_strings[RPC_DISPLAY_NETID]; map->r_addr = rpc_sockaddr2uaddr(sap, GFP_ATOMIC); + if (!map->r_addr) { + status = -ENOMEM; + dprintk("RPC: %5u %s: no memory available\n", + task->tk_pid, __func__); + goto bailout_free_args; + } map->r_owner = ""; break; case RPCBVERS_2: @@ -794,6 +800,8 @@ void rpcb_getport_async(struct rpc_task *task) rpc_put_task(child); return; +bailout_free_args: + kfree(map); bailout_release_client: rpc_release_client(rpcb_clnt); bailout_nofree: |