ethernet: ucc_geth: fix use-after-free in ucc_geth_remove()
commitd33701e2d16e4e91db50849ea10dfc7938d8918e
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Fri, 18 Dec 2020 10:55:38 +0000 (18 11:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 18:49:01 +0000 (12 19:49 +0100)
tree5955fda50084e00bc177e5da282759f7dc8b80f9
parentf679fa0d018e40f3fd19168f8fd8d587ec5ef3d2
ethernet: ucc_geth: fix use-after-free in ucc_geth_remove()

[ Upstream commit e925e0cd2a705aaacb0b907bb3691fcac3a973a4 ]

ugeth is the netdiv_priv() part of the netdevice. Accessing the memory
pointed to by ugeth (such as done by ucc_geth_memclean() and the two
of_node_puts) after free_netdev() is thus use-after-free.

Fixes: 80a9fad8e89a ("ucc_geth: fix module removal")
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/freescale/ucc_geth.c