]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
SUNRPC: Fix a use after free when a server rejects the RPCSEC_GSS credential
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 29 May 2019 16:49:52 +0000 (12:49 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jun 2019 10:19:15 +0000 (12:19 +0200)
commit42b761f6066a1be9a7bdbf2a79939567b3563a13
treeba5e33079c06fd0bda18c70d7383a9c0c8ec18aa
parentca41657949ab1a1f04b6fc2d9d30d32b13b5677d
SUNRPC: Fix a use after free when a server rejects the RPCSEC_GSS credential

commit 7987b694ade8cc465ce10fb3dceaa614f13ceaf3 upstream.

The addition of rpc_check_timeout() to call_decode causes an Oops
when the RPCSEC_GSS credential is rejected.
The reason is that rpc_decode_header() will call xprt_release() in
order to free task->tk_rqstp, which is needed by rpc_check_timeout()
to check whether or not we should exit due to a soft timeout.

The fix is to move the call to xprt_release() into call_decode() so
we can perform it after rpc_check_timeout().

Reported-by: Olga Kornievskaia <olga.kornievskaia@gmail.com>
Reported-by: Nick Bowler <nbowler@draconx.ca>
Fixes: cea57789e408 ("SUNRPC: Clean up")
Cc: stable@vger.kernel.org # v5.1+
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/clnt.c