Skip to contentSkip to conversation

fuse: wait for sync init request after abort

PATCH New David Lee 1 participant 1 message Aug 4

Subsystems (2)
lore
Share & tools
lore

David Lee

author
#0 lore raw

PATCH v2 1/1 fuse: wait for sync init request after abort

From: Kyle Zeng <[email protected]>

After a fatal signal interrupts synchronous FUSE_INIT, request_wait_answer() aborts the channel and returns immediately. If the request is in an FR_LOCKED reply-copy interval, fuse_chan_abort() leaves it for the writer to finish. The synchronous caller can then free the fuse_init_args that owns the reply destination while the writer is still copying into it.

Wait for fuse_request_end() after aborting the channel. This keeps the synchronous caller's reply storage alive until any locked copy has finished, while preserving the fatal-signal abort behavior.

Fixes 204aa22a686b ("fuse: abort on fatal signal during sync init")
Assisted-by Codex:gpt-5.6-sol Codex:gpt-5.5-cyber

---
Changes in v2:
- Restore Kyle Zeng as the patch author and correct the sign-off chain.
- Move the research credit below the commit-message separator.

v1: https://lore.kernel.org/all/[email protected]/

Bug found and triaged by OpenAI Security Research and validated by Trail of Bits.

Trail of Bits has a reproducer for this bug that triggers a KASAN use-after-free and can share if needed.

 fs/fuse/dev.c | 2 ++
 1 file changed, 2 insertions(+)
fs/fuse/dev.c +2 -0
index 5763a7cd3..deee1585d 100644
@@ -725,6 +725,8 @@ static void request_wait_answer(struct fuse_req *req)
 
 		if (req->args->abort_on_kill) {
 			fuse_chan_abort(fch, false);
+			wait_event(req->waitq,
+				   test_bit(FR_FINISHED, &req->flags));
 			return;
 		}
 
Signature · 1 line
2.53.0