From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Yi Xie <xieyi@kylinos.cn>, axboe@kernel.dk
Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org,
Yi Xie <xieyi@kylinos.cn>
Subject: Re: [PATCH 1/5] io_uring/fs: check unused sqe fields for unlinkat
Date: Tue, 14 Jul 2026 15:00:47 -0400 [thread overview]
Message-ID: <878q7d4crk.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <20260714030306.64820-1-xieyi@kylinos.cn>
Yi Xie <xieyi@kylinos.cn> writes:
> Zero check unused SQE fields addr3 and pad2 for unlinkat. They're
> not needed now, but could be used sometime in the future.
>
> Signed-off-by: Yi Xie <xieyi@kylinos.cn>
Arguably, this is a common issue across many operations. I'd love
to have a more automated way to write these checks.
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
> ---
> io_uring/fs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/io_uring/fs.c b/io_uring/fs.c
> index d0580c754bf8..26ea841a22e7 100644
> --- a/io_uring/fs.c
> +++ b/io_uring/fs.c
> @@ -110,7 +110,8 @@ int io_unlinkat_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
> const char __user *fname;
> int err;
>
> - if (sqe->off || sqe->len || sqe->buf_index || sqe->splice_fd_in)
> + if (sqe->off || sqe->len || sqe->buf_index || sqe->splice_fd_in ||
> + sqe->addr3 || sqe->__pad2[0])
> return -EINVAL;
> if (unlikely(req->flags & REQ_F_FIXED_FILE))
> return -EBADF;
> --
> 2.25.1
>
--
Gabriel Krisman Bertazi
next prev parent reply other threads:[~2026-07-14 19:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 3:03 [PATCH 1/5] io_uring/fs: check unused sqe fields for unlinkat Yi Xie
2026-07-14 19:00 ` Gabriel Krisman Bertazi [this message]
2026-07-14 19:18 ` Jens Axboe
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=878q7d4crk.fsf@mailhost.krisman.be \
--to=krisman@suse.de \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xieyi@kylinos.cn \
/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