Netdev List
 help / color / mirror / Atom feed
From: Junnan Zhang <zhangjn_dev@163.com>
To: netdev-bot+sashiko@kernel.org
Cc: davem@davemloft.net, edumazet@google.com, horms@kernel.org,
	kuba@kernel.org, linux-kernel@vger.kernel.org,
	liuhangbin@gmail.com, mst@redhat.com, netdev@vger.kernel.org,
	pabeni@redhat.com, sunshx@chinatelecom.cn,
	willemdebruijn.kernel@gmail.com, zhangjn11@chinatelecom.cn,
	zhangjn_dev@163.com
Subject: Re: [PATCH net v3] net/packet: fix network header offset for non-VLAN raw packets on VLAN subinterfaces
Date: Fri,  4 Sep 2026 15:47:31 +0800	[thread overview]
Message-ID: <20260904074731.42652-1-zhangjn_dev@163.com> (raw)
In-Reply-To: <178842152801.3394541.15512936705284584859@kernel.org>

Hi,

The High finding from the Sashiko review is correct.

Commit 447cbe95ebb953 ("vlan: fix skb_under_panic and races when
toggling HW VLAN offload") is now in mainline (v7.3-rc1). It makes
vlan_dev_init() keep hard_header_len == real_dev->hard_header_len
unconditionally and accounts VLAN tag space in needed_headroom
instead.

With that change, a VLAN subinterface on a plain Ethernet NIC has
hard_header_len == min_header_len == ETH_HLEN, so packet_snd() already
places network_header at the L2/L3 boundary of the user-supplied
frame. The branch added by this patch writes back the identical value
and is a no-op. I applied 447cbe95ebb953 on my baseline and re-ran my
reproducer (virtio_net without NETIF_F_HW_VLAN_CTAG_TX, AF_PACKET
SOCK_RAW + PACKET_VNET_HDR over a VLAN subinterface): the failure is
gone.

On the Medium finding: the concern is valid. For a VLAN subinterface
over a with hard_header_len < min_header_len (e.g.
cx82310_eth, which sets hard_header_len = 0), the new branch would
point network_header at min_header_len even for frames shorter than
that, recreating the mac_len > skb->len state that 993675a3100b1
(": reset network header if packet shorter than ll reserved
space") was written to avoid. Had the patch survived, it would need a
frame-length guard (e.g. skb->len >= skb->dev->min_header_len).

My v1-v3 baseline predated 447cbe95ebb953, which is why the issue
reproduced back then. The patch is now superseded; please drop it if
it is still queued.

Willem, thank you for the thorough reviews on all three versions.

Thanks,
Junnan


      reply	other threads:[~2026-09-04  7:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  7:42 [PATCH net v3] net/packet: fix network header offset for non-VLAN raw packets on VLAN subinterfaces Junnan Zhang
2026-09-01 14:06 ` Willem de Bruijn
2026-09-03  7:45 ` [net,v3] " netdev-bot+sashiko
2026-09-04  7:47   ` Junnan Zhang [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=20260904074731.42652-1-zhangjn_dev@163.com \
    --to=zhangjn_dev@163.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=mst@redhat.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sunshx@chinatelecom.cn \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=zhangjn11@chinatelecom.cn \
    /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