summaryrefslogtreecommitdiffstats
path: root/drivers/net/ipvlan/ipvlan.h
diff options
context:
space:
mode:
authorMahesh Bandewar <maheshb@google.com>2022-11-16 02:19:14 +0100
committerDavid S. Miller <davem@davemloft.net>2022-11-18 11:39:22 +0100
commit40b9d1ab63f5c4f3cb69450044d07b45e5af72e1 (patch)
tree773c981b4357becfd3258719c1138e268508839a /drivers/net/ipvlan/ipvlan.h
parentnet: neigh: decrement the family specific qlen (diff)
downloadlinux-40b9d1ab63f5c4f3cb69450044d07b45e5af72e1.tar.xz
linux-40b9d1ab63f5c4f3cb69450044d07b45e5af72e1.zip
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: 2ad7bf363841 ("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>
Diffstat (limited to 'drivers/net/ipvlan/ipvlan.h')
-rw-r--r--drivers/net/ipvlan/ipvlan.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ipvlan/ipvlan.h b/drivers/net/ipvlan/ipvlan.h
index de94921cbef9..025e0c19ec25 100644
--- a/drivers/net/ipvlan/ipvlan.h
+++ b/drivers/net/ipvlan/ipvlan.h
@@ -98,6 +98,7 @@ struct ipvl_port {
struct sk_buff_head backlog;
int count;
struct ida ida;
+ netdevice_tracker dev_tracker;
};
struct ipvl_skb_cb {