]> git.baikalelectronics.ru Git - kernel.git/commit
ipvlan: hold lower dev to avoid possible use-after-free
authorMahesh Bandewar <maheshb@google.com>
Wed, 16 Nov 2022 01:19:14 +0000 (17:19 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Nov 2022 10:39:22 +0000 (10:39 +0000)
commit89a2707f6a78e3575f74278bf1d635834a3844ba
tree773c981b4357becfd3258719c1138e268508839a
parent5544725e389aba854bbed560a744971939a2074c
ipvlan: hold lower dev to avoid possible use-after-free

Recently syzkaller discovered the issue of disappearing lower
device (NETDEV_UNREGISTER) while the virtual device (like
macvlan) is still having it as a lower device. So it's just
a matter of time similar discovery will be made for IPvlan
device setup. So fixing it preemptively. Also while at it,
add a refcount tracker.

Fixes: a346ddd1a0fb ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipvlan/ipvlan.h
drivers/net/ipvlan/ipvlan_main.c