[PATCH net-next v2 0/3] net: ipvlan: fix potential UAF problem for phy_dev

From: Ziyang Xuan
Date: Thu Mar 17 2022 - 21:39:38 EST


Add the reference operation to phy_dev of ipvlan to avoid
the potential UAF problem under the following known scenario:

Someone module puts the NETDEV_UNREGISTER event handler to a
work, and phy_dev is accessed in the work handler. But when
the work is excuted, phy_dev has been destroyed because upper
ipvlan did not get reference to phy_dev correctly.

In addition, add net device refcount tracker to ipvlan and
fix some error comments for ipvtap module.

------
v1->v2:
- Add "Fixes: tag" for fix patches.

Ziyang Xuan (3):
net: ipvlan: fix potential UAF problem for phy_dev
net: ipvlan: add net device refcount tracker
net: ipvtap: fix error comments

drivers/net/ipvlan/ipvlan.h | 1 +
drivers/net/ipvlan/ipvlan_main.c | 13 +++++++++++++
drivers/net/ipvlan/ipvtap.c | 4 ++--
3 files changed, 16 insertions(+), 2 deletions(-)

--
2.25.1