From: Joe Damato <jdamato@fastly.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, Simon Horman <horms@kernel.org>,
eric.dumazet@gmail.com,
syzbot+4f66250f6663c0c1d67e@syzkaller.appspotmail.com,
stable@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH net] net: tun: fix tun_napi_alloc_frags()
Date: Thu, 12 Dec 2024 14:33:11 -0800 [thread overview]
Message-ID: <Z1tkp3m7hNxQ8hF6@LQ3V64L9R2> (raw)
In-Reply-To: <20241212222247.724674-1-edumazet@google.com>
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/#u
> 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);
> + const struct iovec *iov = iter_iov(it) + i;
> size_t fragsz = iov->iov_len;
> struct page *page;
> void *frag;
> --
Reviewed-by: Joe Damato <jdamato@fastly.com>
next prev parent reply other threads:[~2024-12-12 22:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 22:22 [PATCH net] net: tun: fix tun_napi_alloc_frags() Eric Dumazet
2024-12-12 22:33 ` Joe Damato [this message]
2024-12-12 22:33 ` Jens Axboe
2024-12-13 17:13 ` Willem de Bruijn
2024-12-13 18:56 ` Michael S. Tsirkin
2024-12-14 3:40 ` patchwork-bot+netdevbpf
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=Z1tkp3m7hNxQ8hF6@LQ3V64L9R2 \
--to=jdamato@fastly.com \
--cc=axboe@kernel.dk \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=syzbot+4f66250f6663c0c1d67e@syzkaller.appspotmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.