linux-uconsole/drivers/net/ethernet
Ivan Mironov 6384c67c64 bnx2x: Fix NULL pointer dereference in bnx2x_del_all_vlans() on some hw
commit 38355a5f9a upstream.

This happened when I tried to boot normal Fedora 29 system with latest
available kernel (from fedora rawhide, plus some unrelated custom
patches):

	BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
	PGD 0 P4D 0
	Oops: 0010 [#1] SMP PTI
	CPU: 6 PID: 1422 Comm: libvirtd Tainted: G          I       4.20.0-0.rc7.git3.hpsa2.1.fc29.x86_64 #1
	Hardware name: HP ProLiant BL460c G6, BIOS I24 05/21/2018
	RIP: 0010:          (null)
	Code: Bad RIP value.
	RSP: 0018:ffffa47ccdc9fbe0 EFLAGS: 00010246
	RAX: 0000000000000000 RBX: 00000000000003e8 RCX: ffffa47ccdc9fbf8
	RDX: ffffa47ccdc9fc00 RSI: ffff97d9ee7b01f8 RDI: ffff97d9f0150b80
	RBP: ffff97d9f0150b80 R08: 0000000000000000 R09: 0000000000000000
	R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000003
	R13: ffff97d9ef1e53e8 R14: 0000000000000009 R15: ffff97d9f0ac6730
	FS:  00007f4d224ef700(0000) GS:ffff97d9fa200000(0000) knlGS:0000000000000000
	CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
	CR2: ffffffffffffffd6 CR3: 00000011ece52006 CR4: 00000000000206e0
	Call Trace:
	 ? bnx2x_chip_cleanup+0x195/0x610 [bnx2x]
	 ? bnx2x_nic_unload+0x1e2/0x8f0 [bnx2x]
	 ? bnx2x_reload_if_running+0x24/0x40 [bnx2x]
	 ? bnx2x_set_features+0x79/0xa0 [bnx2x]
	 ? __netdev_update_features+0x244/0x9e0
	 ? netlink_broadcast_filtered+0x136/0x4b0
	 ? netdev_update_features+0x22/0x60
	 ? dev_disable_lro+0x1c/0xe0
	 ? devinet_sysctl_forward+0x1c6/0x211
	 ? proc_sys_call_handler+0xab/0x100
	 ? __vfs_write+0x36/0x1a0
	 ? rcu_read_lock_sched_held+0x79/0x80
	 ? rcu_sync_lockdep_assert+0x2e/0x60
	 ? __sb_start_write+0x14c/0x1b0
	 ? vfs_write+0x159/0x1c0
	 ? vfs_write+0xba/0x1c0
	 ? ksys_write+0x52/0xc0
	 ? do_syscall_64+0x60/0x1f0
	 ? entry_SYSCALL_64_after_hwframe+0x49/0xbe

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: 04f05230c5 ("bnx2x: Remove configured vlans as part of unload sequence.")
Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
Acked-by: Sudarsana Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-13 09:51:11 +01:00
..
3com net: prevent ISA drivers from building on PPC32 2018-07-22 11:12:29 -07:00
8390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-08-15 15:04:25 -07:00
adaptec net: adaptec: Replace mdelay() with msleep() in starfire_init_one() 2018-07-26 21:24:23 -07:00
aeroflex
agere
alacritech
allwinner
alteon alteon: acenic: mark expected switch fall-through 2018-08-07 17:54:19 -07:00
altera
amazon net: ena: fix crash during failed resume from hibernation 2018-12-13 09:16:13 +01:00
amd net: amd: add missing of_node_put() 2018-12-13 09:16:15 +01:00
apm drivers: net: xgene: Remove unnecessary forward declarations 2019-01-13 09:51:00 +01:00
apple net: apple: fix return type of ndo_start_xmit function 2018-09-21 19:15:15 -07:00
aquantia net: aquantia: fix rx checksum offload bits 2018-12-21 14:15:16 +01:00
arc
atheros Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2018-07-24 19:21:58 -07:00
aurora
broadcom bnx2x: Fix NULL pointer dereference in bnx2x_del_all_vlans() on some hw 2019-01-13 09:51:11 +01:00
brocade
cadence net: macb: add missing barriers when reading descriptors 2019-01-13 09:51:02 +01:00
calxeda Merge 4.18-rc5 into char-misc-next 2018-07-16 09:04:54 +02:00
cavium liquidio: read sc->iq_no before release sc 2018-12-21 14:15:17 +01:00
chelsio net: cxgb3_main: fix a missing-check bug 2018-10-05 11:47:19 -07:00
cirrus net: cirrus: fix return type of ndo_start_xmit function 2018-09-21 19:15:14 -07:00
cisco net: cisco: enic: Replace GFP_ATOMIC with GFP_KERNEL 2018-08-04 13:08:06 -07:00
cortina net: gemini: Fix copy/paste error 2018-12-05 19:31:58 +01:00
davicom
dec net: tulip: de4x5: mark expected switch fall-throughs 2018-08-07 17:54:19 -07:00
dlink
emulex Revert "be2net: remove desc field from be_eq_obj" 2018-11-04 14:50:53 +01:00
ezchip
faraday net: faraday: ftmac100: remove netif_running(netdev) check before disabling interrupts 2018-12-13 09:16:14 +01:00
freescale ethernet: fman: fix wrong of_node_put() in probe function 2018-12-21 14:15:21 +01:00
fujitsu
hisilicon net: hns: Fix ping failed when use net bridge and send multicast 2019-01-13 09:51:01 +01:00
hp net: hp100: fix always-true check for link up state 2018-09-17 07:55:19 -07:00
huawei hinic: remove ndo_poll_controller 2018-09-28 11:12:28 -07:00
i825xx net: i825xx: fix return type of ndo_start_xmit function 2018-09-21 19:15:15 -07:00
ibm ibmvnic: Fix non-atomic memory allocation in IRQ context 2019-01-13 09:50:58 +01:00
intel ixgbe: Fix race when the VF driver does a reset 2019-01-13 09:50:59 +01:00
marvell net: mvneta: fix operation for 64K PAGE_SIZE 2019-01-09 17:38:36 +01:00
mediatek net-next: mediatek: cleanup unnecessary get chip id and its user 2018-07-29 13:15:57 -07:00
mellanox net/mlx5e: RX, Fix wrong early return in receive queue poll 2019-01-09 17:38:36 +01:00
micrel Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-08-15 16:01:47 -07:00
microchip lan743x: Remove MAC Reset from initialization 2019-01-13 09:51:03 +01:00
moxa
mscc mscc: Configured MAC entries should be locked. 2019-01-09 17:38:35 +01:00
myricom
natsemi
neterion vxge: ensure data0 is initialized in when fetching firmware version information 2019-01-13 09:51:02 +01:00
netronome nfp: flower: ensure TCP flags can be placed in IPv6 frame 2019-01-09 17:38:35 +01:00
ni net: nixge: Don't store skb in app4 field of descriptor 2018-08-13 08:49:37 -07:00
nuvoton w90p910_ether: remove incorrect __init annotation 2019-01-13 09:51:00 +01:00
nvidia net: nvidia: forcedeth: Replace GFP_ATOMIC with GFP_KERNEL in nv_probe() 2018-07-27 13:45:14 -07:00
nxp
oki-semi
packetengines
pasemi
qlogic net: netxen: fix a missing check and an uninitialized use 2019-01-13 09:51:03 +01:00
qualcomm net: qualcomm: rmnet: Fix incorrect assignment of real_dev 2018-11-23 08:17:06 +01:00
rdc
realtek r8169: fix WoL device wakeup enable 2019-01-09 17:38:36 +01:00
renesas ravb: do not write 1 to reserved bits 2018-09-18 20:09:57 -07:00
rocker
samsung net: ethernet: sxgbe: mark expected switch fall-throughs 2018-08-07 17:54:20 -07:00
seeq net: seeq: fix return type of ndo_start_xmit function 2018-09-21 19:15:14 -07:00
sfc sfc-falcon: remove ndo_poll_controller 2018-09-28 11:12:29 -07:00
sgi net: sgi: fix return type of ndo_start_xmit function 2018-09-21 19:15:14 -07:00
silan
sis
smsc ARM: 32-bit SoC platform updates 2018-08-23 13:44:43 -07:00
socionext net: ethernet: ave: Replace NET_IP_ALIGN with AVE_FRAME_HEADROOM 2018-12-21 14:15:14 +01:00
stmicro net: stmmac: Fix an error code in probe() 2019-01-09 17:38:32 +01:00
sun
synopsys net: ethernet: Use existing define with polynomial 2018-07-27 19:16:37 +08:00
tehuti
ti net: ethernet: ti: add missing GENERIC_ALLOCATOR dependency 2018-09-17 07:49:33 -07:00
toshiba
tundra
via
wiznet net: wiznet: fix return type of ndo_start_xmit function 2018-09-21 19:15:15 -07:00
xilinx Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2018-07-24 19:21:58 -07:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c net: jme: Replace mdelay() with msleep() and usleep_range() in jme_wait_link() 2018-07-27 13:45:14 -07:00
jme.h
Kconfig net: change Exar/Neterion menu items to be alphabetical 2018-08-01 09:49:02 -07:00
korina.c
lantiq_etop.c MIPS: lantiq: dma: add dev pointer 2018-09-11 23:33:19 -07:00
Makefile net: change Exar/Neterion menu items to be alphabetical 2018-08-01 09:49:02 -07:00
netx-eth.c