diff options
| author | Sophon Zhang <aiqubits@hotmail.com> | 2026-09-01 01:09:53 +0800 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-09-01 18:21:01 +0200 |
| commit | 8d7b3e41ffecc69388a566ecc52093d292074c2a (patch) | |
| tree | b225e141b05ce3d19707846de92d8e0da7229397 /scripts/Makefile.thinlto | |
| parent | 7b15d6cf25e6c2aea77129179b75c191b20d79a9 (diff) | |
| download | linux-stable-8d7b3e41ffecc69388a566ecc52093d292074c2a.tar.gz linux-stable-8d7b3e41ffecc69388a566ecc52093d292074c2a.zip | |
rust: pci: reject IRQ vector indices that do not fit in u32
IrqVectorRegistration::index() accepts a usize, but pci_irq_vector()
takes an unsigned int. On 64-bit architectures, casting an index larger
than u32::MAX wraps it before the PCI core can validate it. In
particular, u32::MAX + 1 becomes zero and can resolve to the first
allocated vector.
Use a checked conversion and return EINVAL when the index cannot be
represented by the C API.
Fixes: 2fb7755b0a7e ("rust: pci: resolve IRQ in index() and embed IrqRequest in IrqVector")
Signed-off-by: Sophon Zhang <aiqubits@hotmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://patch.msgid.link/20260901-fix-pci-irq-vector-index-truncation-v4-1-f94aa6932fd9@hotmail.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
