From: Pavel Begunkov Date: Fri, 25 Oct 2019 09:31:29 +0000 (+0300) Subject: io_uring: Fix corrupted user_data X-Git-Tag: for-linus-2019-10-26~8 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=84d55dc5b9e57b513a702fbc358e1b5489651590;p=linux-2.6-block.git io_uring: Fix corrupted user_data There is a bug, where failed linked requests are returned not with specified @user_data, but with garbage from a kernel stack. The reason is that io_fail_links() uses req->user_data, which is uninitialised when called from io_queue_sqe() on fail path. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index 1b46c72f8975..0e141d905a5b 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2448,6 +2448,8 @@ err: return; } + req->user_data = s->sqe->user_data; + /* * If we already have a head request, queue this one for async * submittal once the head completes. If we don't have a head but