# 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 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/09/17659589
- Thread: https://ratatoskr.run/netdev/2026/09/17640997/t.md

```text
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni [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


```
