From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Georgios Androutsopoulos" <georgeandrout13@gmail.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
"Danilo Krummrich" <dakr@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Dave Ertman" <david.m.ertman@intel.com>,
"Ira Weiny" <iweiny@kernel.org>,
"Leon Romanovsky" <leon@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Onur Özkan" <work@onurozkan.dev>,
driver-core@lists.linux.dev, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] rust: auxiliary: validate DeviceId name length
Date: Fri, 11 Sep 2026 14:19:00 +0900 [thread overview]
Message-ID: <DLC8EZJDCFY5.15IEPAK1M7ZW@nvidia.com> (raw)
In-Reply-To: <20260910153844.3987791-1-georgeandrout13@gmail.com>
On Fri Sep 11, 2026 at 12:38 AM JST, Georgios Androutsopoulos wrote:
> `DeviceId::new()` copies `modname` and `name` into the fixed 40-byte
> `auxiliary_device_id::name` array without checking that they fit. An
> oversized name is caught by the array bounds check, but the error
> reports an out-of-bounds index in the copy loop rather than the
> constraint the caller violated.
>
> Check the invariant explicitly instead, so the failure states the length
> limit rather than an array index.
>
> This should only be reached when constructing a device ID table, so the
> failure is a compile time error. Document that intent.
>
> Signed-off-by: Georgios Androutsopoulos <georgeandrout13@gmail.com>
That's not an essential change, but its concise and helpful to some
degree, so:
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
next prev parent reply other threads:[~2026-09-11 5:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 15:38 [PATCH v2] rust: auxiliary: validate DeviceId name length Georgios Androutsopoulos
2026-09-11 5:19 ` Alexandre Courbot [this message]
2026-09-11 21:07 ` Danilo Krummrich
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=DLC8EZJDCFY5.15IEPAK1M7ZW@nvidia.com \
--to=acourbot@nvidia.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=david.m.ertman@intel.com \
--cc=driver-core@lists.linux.dev \
--cc=gary@garyguo.net \
--cc=georgeandrout13@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=iweiny@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/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