lkml.org 
[lkml]   [2024]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [syzbot] [net?] kernel BUG in __nla_validate_parse
From
On 3/9/24 11:40 AM, Jakub Kicinski wrote:
> On Sat, 9 Mar 2024 16:25:18 +0100 Eric Dumazet wrote:
>> On Sat, Mar 9, 2024 at 4:13 PM syzbot
>>> ..
>> Petr, can you take a look ?
>>
>> Thanks !
>>
>>
>> commit 2118f9390d83cf942de8b34faf3d35b54f9f4eee
>> Author: Petr Machata <petrm@nvidia.com>
>> Date: Wed Mar 6 13:49:15 2024 +0100
>>
>> net: nexthop: Adjust netlink policy parsing for a new attribute
>
> Yeah
>
> +static const struct nla_policy rtm_nh_policy_del[] = {
> + [NHA_ID] = { .type = NLA_U32 },
> +};
>
> + err = nlmsg_parse(nlh, sizeof(struct nhmsg), tb, NHA_MAX,
> + rtm_nh_policy_del, extack);
>
> The policy size must be >= max_attr (NHA_MAX).

ARRAY_SIZE is sufficient for both tb and parse. That is what the rest of
the file uses.

\
 
 \ /
  Last update: 2024-05-27 15:43    [W:0.055 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site