NFSv4: Fix a use-after-free problem in open()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 26 Mar 2014 20:24:37 +0000 (13:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 May 2014 14:59:27 +0000 (07:59 -0700)
commitdbeeb36eb6046aa44004d4ee2077f3e84b1979d3
tree98977a2547ae4a4e720fcdf0d04b004d8dae54c7
parent9a64345f0369251f2841bccec8054f5bdb2b673b
NFSv4: Fix a use-after-free problem in open()

commit e911b8158ee1def8153849b1641b736026b036e0 upstream.

If we interrupt the nfs4_wait_for_completion_rpc_task() call in
nfs4_run_open_task(), then we don't prevent the RPC call from
completing. So freeing up the opendata->f_attr.mdsthreshold
in the error path in _nfs4_do_open() leads to a use-after-free
when the XDR decoder tries to decode the mdsthreshold information
from the server.

Fixes: 82be417aa37c0 (NFSv4.1 cache mdsthreshold values on OPEN)
Tested-by: Steve Dickson <SteveD@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c