From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+28e5f3d207b14bae122a@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [kvm?] [net?] [virt?] WARNING in virtio_transport_send_pkt_info (2)
Date: Fri, 28 Nov 2025 15:55:49 +0800 [thread overview]
Message-ID: <tencent_632DC56E7095D8E88EEDDECFC479CE6DCC0A@qq.com> (raw)
In-Reply-To: <6928fe78.a70a0220.d98e3.012a.GAE@google.com>
#syz test
diff --git a/net/core/datagram.c b/net/core/datagram.c
index c285c6465923..db253fd890d7 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -636,6 +636,8 @@ int zerocopy_fill_skb_from_iter(struct sk_buff *skb,
struct iov_iter *from, size_t length)
{
int frag = skb_shinfo(skb)->nr_frags;
+ int err;
+ size_t len = length;
if (!skb_frags_readable(skb))
return -EFAULT;
@@ -647,13 +649,17 @@ int zerocopy_fill_skb_from_iter(struct sk_buff *skb,
size_t start;
ssize_t copied;
- if (frag == MAX_SKB_FRAGS)
- return -EMSGSIZE;
+ if (frag == MAX_SKB_FRAGS) {
+ err = -EMSGSIZE;
+ goto fault;
+ }
copied = iov_iter_get_pages2(from, pages, length,
MAX_SKB_FRAGS - frag, &start);
- if (copied < 0)
- return -EFAULT;
+ if (copied < 0) {
+ err = -EFAULT;
+ goto fault;
+ }
length -= copied;
@@ -701,6 +707,9 @@ int zerocopy_fill_skb_from_iter(struct sk_buff *skb,
page_ref_sub(last_head, refs);
}
return 0;
+fault:
+ iov_iter_revert(from, len - length);
+ return err;
}
static int
next prev parent reply other threads:[~2025-11-28 7:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-28 1:44 syzbot
2025-11-28 4:34 ` Edward Adam Davis
2025-11-28 6:47 ` syzbot
2025-11-28 7:55 ` Edward Adam Davis [this message]
2025-11-28 9:02 ` syzbot
2025-11-28 8:09 ` Edward Adam Davis
2025-11-28 9:18 ` syzbot
2025-11-28 8:41 ` [PATCH Next] net: restore the iterator to its original state when an error occurs Edward Adam Davis
2025-11-28 13:05 ` [syzbot ci] " syzbot ci
2025-11-28 13:35 ` [PATCH Next V2] " Edward Adam Davis
2025-11-28 17:39 ` Jakub Kicinski
2025-12-01 3:41 ` Edward Adam Davis
2025-12-01 19:15 ` Jakub Kicinski
2025-12-03 15:55 ` [syzbot] [kvm?] [net?] [virt?] WARNING in virtio_transport_send_pkt_info (2) Edward Adam Davis
2025-12-03 16:27 ` syzbot
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=tencent_632DC56E7095D8E88EEDDECFC479CE6DCC0A@qq.com \
--to=eadavis@qq.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+28e5f3d207b14bae122a@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/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
all inboxes | Powered by JetHome®