summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:17:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:17:07 +0000
commitdbbbbcd6a31c838165cb72aecb42d8b395c65068 (patch)
tree013a5765c5b2dca0d8118acbfadc4af0015977b8 /drivers/net
parentReleasing progress-linux version 6.9.11-1~progress7.99u1. (diff)
downloadlinux-dbbbbcd6a31c838165cb72aecb42d8b395c65068.tar.xz
linux-dbbbbcd6a31c838165cb72aecb42d8b395c65068.zip
Merging upstream version 6.9.12.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--drivers/net/tap.c5
-rw-r--r--drivers/net/tun.c3
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) {