From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org, larry.bassel@oracle.com
Cc: Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 5.4.y] virtio-net: Add validation for used length
Date: Tue, 25 Mar 2025 22:23:31 -0400 [thread overview]
Message-ID: <20250325215012-b1dbc44d1f2f743c@stable.kernel.org> (raw)
In-Reply-To: <20250325234402.2735260-1-larry.bassel@oracle.com>
[ Sasha's backport helper bot ]
Hi,
Summary of potential issues:
⚠️ Found matching upstream commit but patch is missing proper reference to it
Found matching upstream commit: ad993a95c508417acdeb15244109e009e50d8758
WARNING: Author mismatch between patch and found commit:
Backport author: Larry Bassel<larry.bassel@oracle.com>
Commit author: Xie Yongji<xieyongji@bytedance.com>
Status in newer kernel trees:
6.13.y | Present (exact SHA1)
6.12.y | Present (exact SHA1)
6.6.y | Present (exact SHA1)
6.1.y | Present (exact SHA1)
5.15.y | Present (exact SHA1)
5.10.y | Present (different SHA1: c92298d228f6)
Note: The patch differs from the upstream commit:
---
1: ad993a95c5084 ! 1: 34cd3a563c1ba virtio-net: Add validation for used length
@@ Metadata
## Commit message ##
virtio-net: Add validation for used length
+ commit ad993a95c508 ("virtio-net: Add validation for used length")
+
This adds validation for used length (might come
from an untrusted device) to avoid data corruption
or loss.
@@ Commit message
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20210531135852.113-1-xieyongji@bytedance.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+ (cherry picked from commit ad993a95c508417acdeb15244109e009e50d8758)
+ [Larry: backport to 5.4.y. Minor conflict resolved due to missing commit 9ce6146ec7b50
+ virtio_net: Add XDP frame size in two code paths]
+ Signed-off-by: Larry Bassel <larry.bassel@oracle.com>
## drivers/net/virtio_net.c ##
@@ drivers/net/virtio_net.c: static struct sk_buff *receive_small(struct net_device *dev,
@@ drivers/net/virtio_net.c: static struct sk_buff *receive_mergeable(struct net_de
head_skb = NULL;
stats->bytes += len - vi->hdr_len;
++ truesize = mergeable_ctx_to_truesize(ctx);
+ if (unlikely(len > truesize)) {
+ pr_debug("%s: rx error: len %u exceeds truesize %lu\n",
+ dev->name, len, (unsigned long)ctx);
@@ drivers/net/virtio_net.c: static struct sk_buff *receive_mergeable(struct net_de
}
rcu_read_unlock();
+- truesize = mergeable_ctx_to_truesize(ctx);
- if (unlikely(len > truesize)) {
- pr_debug("%s: rx error: len %u exceeds truesize %lu\n",
- dev->name, len, (unsigned long)ctx);
@@ drivers/net/virtio_net.c: static struct sk_buff *receive_mergeable(struct net_de
- }
-
head_skb = page_to_skb(vi, rq, page, offset, len, truesize, !xdp_prog,
- metasize, !!headroom);
+ metasize);
curr_skb = head_skb;
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.4.y | Success | Success |
prev parent reply other threads:[~2025-03-26 2:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-25 23:44 [PATCH 5.4.y] virtio-net: Add validation for used length Larry Bassel
2025-03-26 1:02 ` Harshit Mogalapalli
2025-03-26 1:17 ` Greg KH
2025-03-26 1:32 ` Harshit Mogalapalli
2025-03-26 1:37 ` Greg KH
2025-03-26 1:45 ` Harshit Mogalapalli
2025-03-26 2:23 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250325215012-b1dbc44d1f2f743c@stable.kernel.org \
--to=sashal@kernel.org \
--cc=larry.bassel@oracle.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox