]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
e1000: check on netif_running() before calling e1000_up()
authorBo Chen <chenbo@pdx.edu>
Mon, 23 Jul 2018 16:01:29 +0000 (09:01 -0700)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:29 +0000 (19:51 -0600)
commit1d361a473087dd3a0b39039f8e9ef4b6dc8c94f8
tree58207bfd71ff832479e9cd550c72805f319319fe
parent7de7ca85e9b03f65225d593ee8a01c09c5011974
e1000: check on netif_running() before calling e1000_up()

BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit cf1acec008f8d7761aa3fd7c4bca7e17b2d2512d ]

When the device is not up, the call to 'e1000_up()' from the error handling path
of 'e1000_set_ringparam()' causes a kernel oops with a null-pointer
dereference. The null-pointer dereference is triggered in function
'e1000_alloc_rx_buffers()' at line 'buffer_info = &rx_ring->buffer_info[i]'.

This bug was reported by COD, a tool for testing kernel module binaries I am
building. This bug was also detected by KFI from Dr. Kai Cong.

This patch fixes the bug by checking on 'netif_running()' before calling
'e1000_up()' in 'e1000_set_ringparam()'.

Signed-off-by: Bo Chen <chenbo@pdx.edu>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/intel/e1000/e1000_ethtool.c