linux/rust
Georgios Androutsopoulos a4aaec5580 rust: auxiliary: validate DeviceId name length
`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>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://patch.msgid.link/20260910153844.3987791-1-georgeandrout13@gmail.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-09-11 23:03:48 +02:00
..
bindings Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
helpers Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
kernel rust: auxiliary: validate DeviceId name length 2026-09-11 23:03:48 +02:00
macros rust: io: register: unify handling of register with/without bitfields 2026-09-06 13:39:49 +02:00
pin-init rust: pin-init: add #[inline] to small functions 2026-08-05 11:36:18 +01:00
proc-macro2 rust: proc-macro2: rebuild if the version text changes 2026-01-23 10:44:27 +01:00
quote rust: quote: add README.md 2025-11-24 17:15:43 +01:00
syn rust: syn: add README.md 2025-11-24 17:15:47 +01:00
uapi Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
zerocopy rust: zerocopy: update to v0.8.54 2026-07-11 13:46:02 +02:00
zerocopy-derive rust: zerocopy: update to v0.8.54 2026-07-11 13:46:02 +02:00
.gitignore
.kunitconfig
bindgen_parameters rust/bindgen_parameters: Mark s390 types as opaque to prevent repr conflicts 2026-06-10 16:25:13 +02:00
build_error.rs
compiler_builtins.rs rust: Make __udivdi3() and __umoddi3() panic 2026-07-31 16:57:48 +05:30
exports.c kbuild: rust: provide an option to inline C helpers into Rust 2026-03-30 02:03:52 +02:00
ffi.rs
Makefile Rust fixes for v7.3 2026-08-30 09:47:39 -07:00