Commit 2fdb05d
Trond Myklebust
NFSv4.0: Fix a use-after-free problem in the asynchronous open()
Yang Erkun reports that when two threads are opening files at the same
time, and are forced to abort before a reply is seen, then the call to
nfs_release_seqid() in nfs4_opendata_free() can result in a
use-after-free of the pointer to the defunct rpc task of the other
thread.
The fix is to ensure that if the RPC call is aborted before the call to
nfs_wait_on_sequence() is complete, then we must call nfs_release_seqid()
in nfs4_open_release() before the rpc_task is freed.
Reported-by: Yang Erkun <[email protected]>
Fixes: 24ac23a ("NFSv4: Convert open() into an asynchronous RPC call")
Reviewed-by: Yang Erkun <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>1 parent c968fd2 commit 2fdb05d
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2603 | 2603 | | |
2604 | 2604 | | |
2605 | 2605 | | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
2606 | 2611 | | |
2607 | 2612 | | |
2608 | 2613 | | |
2609 | | - | |
2610 | | - | |
2611 | | - | |
2612 | 2614 | | |
2613 | 2615 | | |
2614 | 2616 | | |
| |||
0 commit comments