From: Jens Axboe <axboe@kernel.dk>
To: 강희찬 <gganji11@naver.com>, io-uring@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] io_uring/waitid: clear waitid info before copying it to userspace
Date: Sat, 16 May 2026 12:28:02 -0600 [thread overview]
Message-ID: <6a23b132-35bd-425a-b957-c63dc5cbba49@kernel.dk> (raw)
In-Reply-To: <656b27a69e38857237c82fe0c5d11fba@cweb018.nm>
On 5/16/26 12:24 PM, 강희찬 wrote:
>
> IORING_OP_WAITID stores its result fields in struct io_waitid::info and
> later copies them to userspace siginfo. The prep path initializes the
> request arguments, but it does not initialize info itself.
>
> If the wait operation completes without reporting a child event, the common
> wait code can return without writing wo_info. In that case io_waitid_finish()
> still copies iw->info to userspace, exposing stale bytes from the reused
> io_kiocb command storage.
>
> Clear the result storage during prep so the io_uring path matches the
> regular waitid syscall, which uses a zero-initialized struct waitid_info.
>
> Fixes: f31ecf671ddc ("io_uring: add IORING_OP_WAITID support")
> Cc: stable@vger.kernel.org # 6.7+
> Signed-off-by: Heechan Kang <gganji11@naver.com>
> ---
> io_uring/waitid.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/io_uring/waitid.c b/io_uring/waitid.c
> index d25d60aed6a..32f68fd7fcd 100644
> --- a/io_uring/waitid.c
> +++ b/io_uring/waitid.c
> @@ -275,6 +275,7 @@int io_waitid_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
> iw->options = READ_ONCE(sqe->file_index);
> iw->head = NULL;
> iw->infop = u64_to_user_ptr(READ_ONCE(sqe->addr2));
> + memset(&iw->info, 0, sizeof(iw->info));
> return 0;
> }
Patch looks fine, but you can't send html formatted stuff - it won't make
it to the list, and it also corrupts the patch so it can't get applied.
Send everything plain/text.
--
Jens Axboe
parent reply other threads:[~2026-05-16 18:28 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <656b27a69e38857237c82fe0c5d11fba@cweb018.nm>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a23b132-35bd-425a-b957-c63dc5cbba49@kernel.dk \
--to=axboe@kernel.dk \
--cc=gganji11@naver.com \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®