Commit 070efb83 authored by Pavel Skripkin's avatar Pavel Skripkin Committed by Ze Zuo
Browse files

net: qcom/emac: fix UAF in emac_remove

stable inclusion
from stable-v4.19.199
commit 11e9d163d631198bb3eb41a677a61b499516c0f7
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9S29U
CVE: CVE-2021-47311

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=11e9d163d631198bb3eb41a677a61b499516c0f7



--------------------------------

commit ad297cd2 upstream.

adpt is netdev private data and it cannot be
used after free_netdev() call. Using adpt after free_netdev()
can cause UAF bug. Fix it by moving free_netdev() at the end of the
function.

Fixes: 54e19bc7 ("net: qcom/emac: do not use devm on internal phy pdev")
Signed-off-by: default avatarPavel Skripkin <paskripkin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZe Zuo <zuoze1@huawei.com>
parent 1db6f4df
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment