diff options
| author | Sagar Taunk <sagartaunk@proton.me> | 2026-09-25 08:55:04 +0000 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-09-29 12:28:03 +0200 |
| commit | 0923198be4ae714b46350f742cb19ccd75bfeafa (patch) | |
| tree | 28da8a6bbc408cbe2216fa1e10087a9a2b033cf8 /tools/perf/scripts/python/stackcollapse.py | |
| parent | f8932b2c0c9ae6fb577bcc05a2080c8498f91c0d (diff) | |
| download | linux-0923198be4ae714b46350f742cb19ccd75bfeafa.tar.gz linux-0923198be4ae714b46350f742cb19ccd75bfeafa.zip | |
rust: net: netlink: validate attribute length before casting to `c_int`
`put()` trusted an unchecked `as` cast from `usize` to `c_int`.
When the length exceeds `i32::MAX` that cast wraps around to a
negative value.
This ultimately resulted in a kernel panic when the reinterpreted
value via `__nla_reserve()` and `skb_put()` became enormous.
Validate payload and header both fit together in a `u16`, rejecting
any payload that wouldn't leave room for `NLA_HDRLEN`.
Fixes: 5eaa5fbb6e6c ("rust: netlink: add raw netlink abstraction")
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Sagar Taunk <sagartaunk@proton.me>
Link: https://patch.msgid.link/20260925085449.22553-1-sagartaunk@proton.me
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
