Re: [PATCH net] can: netlink: fix IFLA_CAN_BITRATE_MAX attribute sizing
From: Marc Kleine-Budde
Date: Wed Oct 21 2026 - 13:13:39 EST
On Sat, 05 Sep 2026 00:20:58 +0800, Zhu Ling <zhuling0805@xxxxxx> wrote:
> can_fill_info() emits IFLA_CAN_BITRATE_MAX with nla_put(), which consumes
> space for both the attribute header and its aligned payload. However,
> can_get_size() accounts for the payload only. The resulting underestimate
> can make filling the netlink response fail with -EMSGSIZE when the skb has
> no remaining slack.
>
> Use nla_total_size() to account for the complete attribute.
>
> [...]
Reviewed-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
--
Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>