All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Eric Dumazet <edumazet@google.com>,
	 "David S . Miller" <davem@davemloft.net>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	 Kuniyuki Iwashima <kuniyu@google.com>,
	 Willem de Bruijn <willemb@google.com>,
	 netdev@vger.kernel.org,  eric.dumazet@gmail.com,
	 Eric Dumazet <edumazet@google.com>,
	 syzbot+30b93b6845b19cc38581@syzkaller.appspotmail.com
Subject: Re: [PATCH net] af_packet: Don't send zero-byte data in tpacket_snd().
Date: Mon, 10 Aug 2026 14:10:58 -0400	[thread overview]
Message-ID: <willemdebruijn.kernel.7febf0acff7c@gmail.com> (raw)
In-Reply-To: <20260810150447.1220864-1-edumazet@google.com>

Eric Dumazet wrote:
> syzbot reported a WARNING in __dev_queue_xmit() triggered via tpacket_snd():
> 
> skb_assert_len
> WARNING: at include/linux/skbuff.h:2753 skb_assert_len
> WARNING: at __dev_queue_xmit+0x21bc/0x4970 net/core/dev.c:4781
> 
> Call Trace:
>  <TASK>
>  dev_queue_xmit include/linux/netdevice.h:3448 [inline]
>  packet_xmit+0x243/0x310 net/packet/af_packet.c:276
>  tpacket_snd net/packet/af_packet.c:2907 [inline]
>  packet_sendmsg+0x28d6/0x4eb0 net/packet/af_packet.c:3134
> 
> When sending 0-byte packets via TPACKET ring buffer on devices with no
> hard header (e.g. dev->hard_header_len == 0), tpacket_fill_skb()
> populates an skb with skb->len == 0 and returns 0. tpacket_snd() then
> forwards this empty skb to packet_xmit(), causing __dev_queue_xmit() to
> hit skb_assert_len(skb).
> 
> Similar checks exist in packet_snd() via commit dc633700f00f
> ("net/af_packet: check len when min_header_len equals to 0") and in
> packet_sendmsg_spkt() via commit 6a341729fb31 ("af_packet: Don't send
> zero-byte data in packet_sendmsg_spkt().").
> 
> Return -EINVAL in tpacket_fill_skb() when skb->len is zero to reject
> zero-length packets in tpacket_snd().
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Reported-by: syzbot+30b93b6845b19cc38581@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/netdev/6a79e807.01d0871a.3a0d52.00ac.GAE@google.com/T/#u
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Willem de Bruijn <willemb@google.com>

  reply	other threads:[~2026-08-10 18:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 15:04 [PATCH net] af_packet: Don't send zero-byte data in tpacket_snd() Eric Dumazet
2026-08-10 18:10 ` Willem de Bruijn [this message]
2026-08-11  5:21 ` Jiayuan Chen

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=willemdebruijn.kernel.7febf0acff7c@gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+30b93b6845b19cc38581@syzkaller.appspotmail.com \
    --cc=willemb@google.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.