Skip to content

net: ipvlan: fix potential UAF problem for phy_dev

Ziyang Xuan lkml netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 3 repliesIn review
  2. v23 patches 2 repliesSuperseded
  3. v13 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Make it clear that the problem can not happen now but for future.
- Delete "Fixes: tag" to avoid backporting to stable.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: ipvlan: fix potential UAF problem for phy_devdrivers/net/ipvlan/ipvlan_main.c+13 -01 reply
2/3net: ipvlan: add net device refcount trackerdrivers/net/ipvlan/ipvlan.h drivers/net/ipvlan/ipvlan_main.c+3 -21 reply
3/3net: ipvtap: fix error commentsdrivers/net/ipvlan/ipvtap.c+2 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

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

There is a known scenario can trigger UAF problem for lower netdevice as following:

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

Although it can not happen for ipvlan now because there is no way to access phy_dev outside ipvlan. But it is necessary to add the reference operation to phy_dev to avoid the potential UAF problem in the future.

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

---
v2->v3:
- Make it clear that the problem can not happen now but for future.
- Delete "Fixes: tag" to avoid backporting to stable.
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(-)
Signature · 1 line
2.25.1