diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:16:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:16:59 +0000 |
commit | 7bd37cf4cf5122db89961faa20e3f1866cfdb452 (patch) | |
tree | 1f8e4ad6fa6c57a612b8a939f0e6d758163214df /drivers/net | |
parent | Adding debian version 6.9.11-1. (diff) | |
download | linux-7bd37cf4cf5122db89961faa20e3f1866cfdb452.tar.xz linux-7bd37cf4cf5122db89961faa20e3f1866cfdb452.zip |
Merging upstream version 6.9.12.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/tap.c | 5 | ||||
-rw-r--r-- | drivers/net/tun.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 9f0495e8df..feeeac715c 100644 --- a/drivers/net/tap.c +++ b/drivers/net/tap.c @@ -1177,6 +1177,11 @@ static int tap_get_user_xdp(struct tap_queue *q, struct xdp_buff *xdp) struct sk_buff *skb; int err, depth; + if (unlikely(xdp->data_end - xdp->data < ETH_HLEN)) { + err = -EINVAL; + goto err; + } + if (q->flags & IFF_VNET_HDR) vnet_hdr_len = READ_ONCE(q->vnet_hdr_sz); diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 92da8c03d9..f0f3fa1fc6 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -2451,6 +2451,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) { |