On Thu, Dec 12, 2024 at 10:22:47PM +0000, Eric Dumazet wrote:
syzbot reported the following crash [1]
Issue came with the blamed commit. Instead of going through all the iov components, we keep using the first one and end up with a malformed skb.
[...]
Fixes: de4f5fed3f23 ("iov_iter: add iter_iovec() helper") Reported-by: syzbot+4f66250f6663c0c1d67e@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/675b61aa.050a0220.599f4.00bb.GAE@google.com/T... Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet edumazet@google.com Cc: Jens Axboe axboe@kernel.dk
drivers/net/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index d7a865ef370b6968c095510ae16b5196e30e54b9..e816aaba8e5f2ed06f8832f79553b6c976e75bb8 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1481,7 +1481,7 @@ static struct sk_buff *tun_napi_alloc_frags(struct tun_file *tfile, skb->truesize += skb->data_len; for (i = 1; i < it->nr_segs; i++) {
const struct iovec *iov = iter_iov(it);
size_t fragsz = iov->iov_len; struct page *page; void *frag;const struct iovec *iov = iter_iov(it) + i;
--
Reviewed-by: Joe Damato jdamato@fastly.com