Message ID | 20240724170452.16837-3-dongli.zhang@oracle.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 049584807f1d797fc3078b68035450a9769eb5c3 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | tap/tun: harden by dropping short frame | expand |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 9b24861464bc..1d06c560c5e6 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -2455,6 +2455,9 @@ static int tun_xdp_one(struct tun_struct *tun, bool skb_xdp = false; struct page *page; + if (unlikely(datasize < ETH_HLEN)) + return -EINVAL; + xdp_prog = rcu_dereference(tun->xdp_prog); if (xdp_prog) { if (gso->gso_type) {