Re: [PATCH net v6] rust: net: netlink: validate attribute length before casting to `c_int`

From
patchwork-bot+netdevbpf@kernel.org
Date
2026-09-29 10:50:17
Also in
lkml, rust-for-linux
Reply to
Sagar Taunk, 2026-09-25
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni [off-list ref]:

On Fri, 25 Sep 2026 08:55:04 +0000 you wrote:
`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.

[...]
Here is the summary with links:
  - [net,v6] rust: net: netlink: validate attribute length before casting to `c_int`
    https://git.kernel.org/netdev/net/c/0923198be4ae

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Thread (2 messages) 2 messages, 2 authors, last reply 2026-09-29
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help