linux_dsm_epyc7002/drivers/net/ethernet
Srinivas Kandagatla 1f9defa0c2 net:stmmac: fix broken stmmac_pltfr_remove.
This patch fixes stmmac_pltfr_remove function, which is broken because,
it is accessing plat variable via freed memory priv pointer which gets
freed by free_netdev called from stmmac_dvr_remove.

In short this patch caches the plat pointer in local variable before
calling stmmac_dvr_remove to prevent code accessing freed memory.

Without this patch any attempt to remove the stmmac device will fail as
below:

Unregistering eth 0 ...
Unable to handle kernel paging request at virtual address 6b6b6bab
pgd = de5dc000
[6b6b6bab] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP
Modules linked in: cdev(O+)
CPU: 0    Tainted: G           O  (3.3.1_stm24_0210-b2000+ #25)
PC is at stmmac_pltfr_remove+0x2c/0xa0
LR is at stmmac_pltfr_remove+0x28/0xa0
pc : [<c01b8908>]    lr : [<c01b8904>]    psr: 60000013
sp : def6be78  ip : de6c5a00  fp : 00000000
r10: 00000028  r9 : c082d81d  r8 : 00000001
r7 : de65a600  r6 : df81b240  r5 : c0413fd8  r4 : 00000000
r3 : 6b6b6b6b  r2 : def6be6c  r1 : c0355e2b  r0 : 00000020
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c53c7d  Table: 5e5dc04a  DAC: 00000015
Process insmod (pid: 738, stack limit = 0xdef6a2f0)
Stack: (0xdef6be78 to 0xdef6c000)
be60:                                                       c0413fe0
c0403658
be80: c0400bb0 c019270c c01926f8 c0191478 00000000 c0414014 c0413fe0
c01914d8
bea0: 00000000 c0413fe0 df8045d0 c019109c c0413fe0 c0400bf0 c0413fd8
c018f04c
bec0: 00000000 bf000000 c0413fd8 c01929a0 c0413fd8 bf000000 00000000
c0192bfc
bee0: bf00009c bf000014 def6a000 c000859c 00000000 00000001 bf00009c
bf00009c
bf00: 00000001 bf00009c 00000001 bf0000e4 de65a600 00000001 c082d81d
c0058cd0
bf20: bf0000a8 c004fbd8 c0056414 c082d815 c02aea20 bf0001f0 00b0b008
e0846208
bf40: c03ec8a0 e0846000 0000db0d e0850604 e08504de e0853a24 00000204
000002d4
bf60: 00000000 00000000 0000001c 0000001d 00000009 00000000 00000006
00000000
bf80: 00000003 f63d4e2e 0000db0d bef02ed8 00000080 c000d2e8 def6a000
00000000
bfa0: 00000000 c000d140 f63d4e2e 0000db0d 00b0b018 0000db0d 00b0b008
b6f4f298
bfc0: f63d4e2e 0000db0d bef02ed8 00000080 00000003 00000000 00010000
00000000
bfe0: 00b0b008 bef02c64 00008d20 b6ef3784 60000010 00b0b018 5a5a5a5a
5a5a5a5a
[<c01b8908>] (stmmac_pltfr_remove+0x2c/0xa0) from [<c019270c>]
(platform_drv_remove+0x14/0x18)
[<c019270c>] (platform_drv_remove+0x14/0x18) from [<c0191478>]
(__device_release_driver+0x64/0xa4)
[<c0191478>] (__device_release_driver+0x64/0xa4) from [<c01914d8>]
(device_release_driver+0x20/0x2c)
[<c01914d8>] (device_release_driver+0x20/0x2c) from [<c019109c>]
(bus_remove_device+0xcc/0xdc)
[<c019109c>] (bus_remove_device+0xcc/0xdc) from [<c018f04c>]
(device_del+0x104/0x160)
[<c018f04c>] (device_del+0x104/0x160) from [<c01929a0>]
(platform_device_del+0x18/0x58)
[<c01929a0>] (platform_device_del+0x18/0x58) from [<c0192bfc>]
(platform_device_unregister+0xc/0x18)
[<c0192bfc>] (platform_device_unregister+0xc/0x18) from [<bf000014>]
(r_init+0x14/0x2c [cdev])
[<bf000014>] (r_init+0x14/0x2c [cdev]) from [<c000859c>]
(do_one_initcall+0x90/0x160)
[<c000859c>] (do_one_initcall+0x90/0x160) from [<c0058cd0>]
(sys_init_module+0x15c4/0x1794)
[<c0058cd0>] (sys_init_module+0x15c4/0x1794) from [<c000d140>]
(ret_fast_syscall+0x0/0x30)
Code: e1a04000 e59f0070 eb039b65 e59636e4 (e5933040)

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-31 16:11:16 -04:00
..
3com drivers/net/ethernet: Fix (nearly-)kernel-doc comments for various functions 2012-07-10 23:13:46 -07:00
8390 net: add support for NS8390 based eth controllers on some ColdFire CPU boards 2012-07-12 07:54:45 -07:00
adaptec starfire: remove deprecated options. 2012-04-07 11:45:26 +02:00
adi bfin: Fix build failure due to get_ts_info() changes. 2012-04-06 00:17:50 -04:00
aeroflex ethernet: Remove casts to same type 2012-06-06 09:31:33 -07:00
alteon Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
amd lance: remove unnecessary setting of skb->dev 2012-07-10 23:24:56 -07:00
apple ethernet: Remove casts to same type 2012-06-06 09:31:33 -07:00
atheros atl1c: fix issue of io access mode for AR8152 v2.1 2012-07-20 11:21:18 -07:00
broadcom bnx2x: Correct the ndo_poll_controller call 2012-08-30 13:36:46 -04:00
brocade drivers/net/ethernet: Fix non-kernel-doc comments with kernel-doc start markers 2012-07-10 23:13:46 -07:00
cadence net/macb: manage carrier state with call to netif_carrier_{on|off}() 2012-07-09 00:03:06 -07:00
calxeda net: calxedaxgmac: enable rx cut-thru mode 2012-07-10 23:25:47 -07:00
chelsio netvm: propagate page->pfmemalloc from skb_alloc_page to skb 2012-07-31 18:42:46 -07:00
cirrus cirrus: cs89x0: Remove function prototypes and reorder declarations 2012-05-18 23:48:07 -04:00
cisco enic: remove unnecessary setting of skb->dev 2012-07-10 23:24:56 -07:00
davicom dm9000: some coldfire boards need this 2012-05-14 18:40:16 -04:00
dec ethernet: Remove casts to same type 2012-06-06 09:31:33 -07:00
dlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-05-07 23:35:40 -04:00
emulex Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-08-31 15:14:18 -04:00
faraday net: ftgmac100/ftmac100: dont pull too much data 2012-07-18 09:40:53 -07:00
freescale Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-08-31 15:14:18 -04:00
fujitsu drivers/net: delete all code/drivers depending on CONFIG_MCA 2012-05-17 16:37:41 -04:00
hp ethernet: Remove casts to same type 2012-06-06 09:31:33 -07:00
i825xx ethernet: Remove casts to same type 2012-06-06 09:31:33 -07:00
ibm drivers/net/ethernet: Fix non-kernel-doc comments with kernel-doc start markers 2012-07-10 23:13:46 -07:00
icplus
intel Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next 2012-08-31 16:03:33 -04:00
marvell Merge branch 'v3.5-rc7-fixes' of git://github.com/lunn/linux into fixes 2012-07-25 21:37:09 +02:00
mellanox Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-08-21 16:46:08 -07:00
micrel ethernet: Use eth_random_addr 2012-07-16 22:38:27 -07:00
microchip
myricom myri10ge: set maximal number of default RSS queues 2012-07-05 03:06:44 -07:00
natsemi drivers/net: delete all code/drivers depending on CONFIG_MCA 2012-05-17 16:37:41 -04:00
neterion net: fix race condition in several drivers when reading stats 2012-07-22 12:12:32 -07:00
nuvoton
nvidia forcedeth: prevent TX timeouts after reboot 2012-08-30 13:04:57 -04:00
nxp lpc_eth: remove obsolete ifdefs 2012-08-08 16:07:51 -07:00
octeon netdev: octeon_mgmt: Convert to use device tree. 2012-07-23 13:54:53 +01:00
oki-semi pch_gbe: vlan skb len fix 2012-07-26 14:30:23 -07:00
packetengines yellowfin: stop using net_device.{base_addr, irq}. 2012-04-07 11:45:26 +02:00
pasemi net/pasemi: fix compiler warning 2012-05-02 20:52:48 -04:00
qlogic qlge: Add offload features to vlan interfaces 2012-07-29 23:18:30 -07:00
racal
rdc r6040: use module_pci_driver macro 2012-07-09 14:42:30 -07:00
realtek r8169: revert "add byte queue limit support". 2012-07-23 18:27:00 -07:00
renesas net: sh_eth: Add eth support for R8A7779 device 2012-08-20 02:16:54 -07:00
seeq seeq: use PTR_RET at init_module of driver 2012-07-29 23:18:30 -07:00
sfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-08-31 15:14:18 -04:00
sgi ethernet: Remove casts to same type 2012-06-06 09:31:33 -07:00
silan sc92031: stop using net_device.{base_addr, irq} 2012-04-07 11:45:27 +02:00
sis sis900: stop using net_device.{base_addr, irq} and convert to __iomem. 2012-04-07 11:47:18 +02:00
smsc ethernet: Use eth_random_addr 2012-07-16 22:38:27 -07:00
stmicro net:stmmac: fix broken stmmac_pltfr_remove. 2012-08-31 16:11:16 -04:00
sun niu: Change niu_rbr_fill() to use unlikely() to check niu_rbr_add_page() return value 2012-07-22 23:31:07 -07:00
tehuti drivers/net/ethernet: Fix (nearly-)kernel-doc comments for various functions 2012-07-10 23:13:46 -07:00
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-08-22 14:21:38 -07:00
tile tilegx net: use eth_hw_addr_random(), not eth_random_addr() 2012-07-18 15:07:45 -04:00
toshiba drivers/net/ethernet: Fix (nearly-)kernel-doc comments for various functions 2012-07-10 23:13:46 -07:00
tundra drivers/net/ethernet/tundra/tsi108_eth.c: delete double assignment 2012-08-30 13:08:37 -04:00
via ethernet: Remove casts to same type 2012-06-06 09:31:33 -07:00
wiznet w5300: using eth_hw_addr_random() for random MAC and set device flag 2012-08-24 13:30:27 -04:00
xilinx ethernet: Use eth_random_addr 2012-07-16 22:38:27 -07:00
xircom Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
xscale ixp4xx_eth: fix ptp_ixp46x build failure 2012-08-06 13:30:01 -07:00
dnet.c dnet: Support the get_ts_info ethtool method. 2012-04-04 05:28:46 -04:00
dnet.h
ethoc.c ethernet: Use eth_random_addr 2012-07-16 22:38:27 -07:00
fealnx.c fealnx: Remove unused local label 'out' in netdev_open(). 2012-04-07 09:02:32 -04:00
jme.c jme: netpoll support 2012-07-18 09:40:54 -07:00
jme.h
Kconfig Ethernet driver for the WIZnet W5300 chip 2012-04-05 01:43:02 -04:00
korina.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
lantiq_etop.c ethernet: Use eth_random_addr 2012-07-16 22:38:27 -07:00
Makefile Ethernet driver for the WIZnet W5300 chip 2012-04-05 01:43:02 -04:00
mipsnet.c
netx-eth.c
s6gmac.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-05-22 19:22:50 -07:00