[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <657a1095-67c7-c262-d05f-39d95d433b54@blackwall.org>
Date: Tue, 22 Mar 2022 11:28:43 +0200
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Eric Dumazet <eric.dumazet@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: netdev <netdev@...r.kernel.org>,
Eric Dumazet <edumazet@...gle.com>,
syzbot <syzkaller@...glegroups.com>,
Tobias Waldekranz <tobias@...dekranz.com>
Subject: Re: [PATCH net-next] net: bridge: mst: prevent NULL deref in
br_mst_info_size()
On 3/22/22 03:23, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> Call br_mst_info_size() only if vg pointer is not NULL.
>
> general protection fault, probably for non-canonical address 0xdffffc0000000058: 0000 [#1] PREEMPT SMP KASAN
> KASAN: null-ptr-deref in range [0x00000000000002c0-0x00000000000002c7]
[snip]
> Fixes: 122c29486e1f ("net: bridge: mst: Support setting and reporting MST port states")
> Reported-by: syzbot <syzkaller@...glegroups.com>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Tobias Waldekranz <tobias@...dekranz.com>
> Cc: Nikolay Aleksandrov <razor@...ckwall.org>
> ---
> net/bridge/br_netlink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> index a8d90fa8621e2dd7b74b16ce527984f40b563ea0..204472449ec9323cedc19326ff600a61d8f510f5 100644
> --- a/net/bridge/br_netlink.c
> +++ b/net/bridge/br_netlink.c
> @@ -119,7 +119,7 @@ static size_t br_get_link_af_size_filtered(const struct net_device *dev,
> /* Each VLAN is returned in bridge_vlan_info along with flags */
> vinfo_sz += num_vlan_infos * nla_total_size(sizeof(struct bridge_vlan_info));
>
> - if (filter_mask & RTEXT_FILTER_MST)
> + if (vg && (filter_mask & RTEXT_FILTER_MST))
> vinfo_sz += br_mst_info_size(vg);
>
> if (!(filter_mask & RTEXT_FILTER_CFM_STATUS))
Thanks,
Acked-by: Nikolay Aleksandrov <razor@...ckwall.org>
Powered by blists - more mailing lists