public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Sidong Yang <sidong.yang@furiosa.ai>
Cc: Jens Axboe <axboe@kernel.dk>,
	Daniel Almeida <daniel.almeida@collabora.com>,
	Caleb Sander Mateos <csander@purestorage.com>,
	Benno Lossin <lossin@kernel.org>, Miguel Ojeda <ojeda@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	io-uring@vger.kernel.org
Subject: Re: [PATCH v4 2/5] io_uring/cmd: zero-init pdu in io_uring_cmd_prep() to avoid UB
Date: Thu, 9 Apr 2026 07:27:18 +0200	[thread overview]
Message-ID: <2026040908-certainly-dealmaker-5530@gregkh> (raw)
In-Reply-To: <20260408140007.8401-3-sidong.yang@furiosa.ai>

On Wed, Apr 08, 2026 at 01:59:59PM +0000, Sidong Yang wrote:
> The pdu field in io_uring_cmd may contain stale data when a request
> object is recycled from the slab cache. Accessing uninitialized or
> garbage memory can lead to undefined behavior in users of the pdu.

Who accesses this?  If that happens, then yes this is a problem, but if
not, then there's no need for this change, right (i.e. either this is a
bug to be fixed now or not.)

> Ensure the pdu buffer is cleared during io_uring_cmd_prep() so that
> each command starts from a well-defined state. This avoids exposing
> uninitialized memory and prevents potential misinterpretation of data
> from previous requests.

Where is the memory exposed and who misinterprets it?

> No functional change is intended other than guaranteeing that pdu is
> always zero-initialized before use.

This strongly implies that this is not needed at all.

thanks,

greg k-h

  reply	other threads:[~2026-04-09  5:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 13:59 [PATCH v4 0/5] Rust io_uring command abstraction for miscdevice Sidong Yang
2026-04-08 13:59 ` [PATCH v4 1/5] rust: bindings: add io_uring headers in bindings_helper.h Sidong Yang
2026-04-08 14:31   ` Miguel Ojeda
2026-04-09  1:20     ` Sidong Yang
2026-04-08 13:59 ` [PATCH v4 2/5] io_uring/cmd: zero-init pdu in io_uring_cmd_prep() to avoid UB Sidong Yang
2026-04-09  5:27   ` Greg Kroah-Hartman [this message]
2026-04-08 14:00 ` [PATCH v4 3/5] rust: io_uring: introduce rust abstraction for io-uring cmd Sidong Yang
2026-04-08 14:00 ` [PATCH v4 4/5] rust: miscdevice: Add `uring_cmd` support Sidong Yang
2026-04-08 14:00 ` [PATCH v4 5/5] samples: rust: Add `uring_cmd` example to `rust_misc_device` Sidong Yang
2026-04-09  5:25 ` [PATCH v4 0/5] Rust io_uring command abstraction for miscdevice Greg Kroah-Hartman

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=2026040908-certainly-dealmaker-5530@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=daniel.almeida@collabora.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sidong.yang@furiosa.ai \
    /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