Re: [PATCH v2] bnx2x: Fix NULL pointer dereference in bnx2x_del_all_vlans() on some hw

From: David Miller
Date: Mon Dec 24 2018 - 17:46:38 EST


From: Ivan Mironov <mironov.ivan@xxxxxxxxx>
Date: Mon, 24 Dec 2018 20:13:05 +0500

> This happened when I tried to boot normal Fedora 29 system with latest
> available kernel (from fedora rawhide, plus some unrelated custom
> patches):
...
> After some investigation I figured out that recently added cleanup code
> tries to call VLAN filtering de-initialization function which exist only
> for newer hardware. Corresponding function pointer is not
> set (== 0) for older hardware, namely these chips:
>
> #define CHIP_NUM_57710 0x164e
> #define CHIP_NUM_57711 0x164f
> #define CHIP_NUM_57711E 0x1650
>
> And I have one of those in my test system:
>
> Broadcom Inc. and subsidiaries NetXtreme II BCM57711E 10-Gigabit PCIe [14e4:1650]
>
> Function bnx2x_init_vlan_mac_fp_objs() from
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h decides whether to
> initialize relevant pointers in bnx2x_sp_objs.vlan_obj or not.
>
> This regression was introduced after v4.20-rc7, and still exists in v4.20
> release.
>
> Fixes: 04f05230c5c13 ("bnx2x: Remove configured vlans as part of unload sequence.")
> Signed-off-by: Ivan Mironov <mironov.ivan@xxxxxxxxx>

Applied, thanks.