mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/3] net: ipvlan: fix potential UAF problem for phy_dev
@ 2022-03-19  9:52 Ziyang Xuan
  2022-03-19  9:52 ` [PATCH net-next v3 1/3] " Ziyang Xuan
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ziyang Xuan @ 2022-03-19  9:52 UTC (permalink / raw)
  To: davem, kuba, pabeni, netdev; +Cc: edumazet, brianvv, linux-kernel

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(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-22 14:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-19  9:52 [PATCH net-next v3 0/3] net: ipvlan: fix potential UAF problem for phy_dev Ziyang Xuan
2022-03-19  9:52 ` [PATCH net-next v3 1/3] " Ziyang Xuan
2022-03-22 14:03   ` Eric Dumazet
2022-03-19  9:53 ` [PATCH net-next v3 2/3] net: ipvlan: add net device refcount tracker Ziyang Xuan
2022-03-22 14:01   ` Eric Dumazet
2022-03-19  9:53 ` [PATCH net-next v3 3/3] net: ipvtap: fix error comments Ziyang Xuan
2022-03-22  9:15 ` [PATCH net-next v3 0/3] net: ipvlan: fix potential UAF problem for phy_dev Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®