public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Pavel Begunkov <[email protected]>, [email protected]
Subject: Re: [PATCH 5.19 1/1] io_uring: explicit sqe padding for ioctl commands
Date: Thu, 7 Jul 2022 17:32:58 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <e6b95a05e970af79000435166185e85b196b2ba2.1657202417.git.asml.silence@gmail.com>

On 7/7/22 8:00 AM, Pavel Begunkov wrote:
> 32 bit sqe->cmd_op is an union with 64 bit values. It's always a good
> idea to do padding explicitly. Also zero check it in prep, so it can be
> used in the future if needed without compatibility concerns.
> 
> Signed-off-by: Pavel Begunkov <[email protected]>
> ---
>  fs/io_uring.c                 | 2 +-
>  include/uapi/linux/io_uring.h | 5 ++++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 0d491ad15b66..3b5e798524e5 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -5066,7 +5066,7 @@ static int io_uring_cmd_prep(struct io_kiocb *req,
>  {
>  	struct io_uring_cmd *ioucmd = &req->uring_cmd;
>  
> -	if (sqe->rw_flags)
> +	if (sqe->rw_flags | sqe->__pad1)

Applied, but this changed to a logical OR instead.

-- 
Jens Axboe


      reply	other threads:[~2022-07-07 23:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 14:00 [PATCH 5.19 1/1] io_uring: explicit sqe padding for ioctl commands Pavel Begunkov
2022-07-07 23:32 ` Jens Axboe [this message]

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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