Trond Myklebust 2fdb05dc09 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 <yangerkun@huawei.com>
Fixes: 24ac23ab88df ("NFSv4: Convert open() into an asynchronous RPC call")
Reviewed-by: Yang Erkun <yangerkun@huawei.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
2024-11-09 11:01:35 -05:00
..
2024-11-08 14:17:37 -05:00
2024-11-08 14:17:37 -05:00
2024-09-12 12:20:41 +02:00
2024-09-12 12:20:41 +02:00
2024-09-23 15:03:13 -04:00
2021-04-05 09:04:20 -04:00
2024-09-23 15:03:30 -04:00
2024-11-08 14:17:37 -05:00
2023-03-06 09:57:12 +01:00
2024-03-09 09:14:51 -05:00
2024-09-24 15:44:18 -07:00
2024-11-08 14:17:37 -05:00
2024-09-23 15:03:30 -04:00
2024-09-23 15:03:30 -04:00
2024-05-31 12:31:41 +02:00
2023-08-19 10:26:29 -04:00
2024-09-23 15:03:30 -04:00