Netdev List
 help / color / mirror / Atom feed
From: xietangxin <xietangxin@h-partners.com>
To: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	John Fastabend <john.r.fastabend@intel.com>,
	Jesse Gross <jesse@nicira.com>, <gaoxingwang1@huawei.com>,
	huyizhen <huyizhen2@huawei.com>
Subject: [BUG] vlan: skb_under_panic when toggling NETIF_F_HW_VLAN_CTAG_TX on lower device
Date: Thu, 16 Jul 2026 20:20:00 +0800	[thread overview]
Message-ID: <99d678ae-c7b2-4b44-b534-b8320679deb3@h-partners.com> (raw)

[BUG] vlan: skb_under_panic when toggling NETIF_F_HW_VLAN_CTAG_TX on lower device

Hi all,

We encountered a skb_under_panic triggered by toggling
NETIF_F_HW_VLAN_CTAG_TX on the lower device while a VLAN device is
up and sending traffic.

Call trace
==========

 skbuff: skb_under_panic: text:ffffc0d2900283d8 len:74 put:14
  head:ffff334820249c00 data:ffff334820249bfe tail:0x48 end:0xc0 dev:vlan4
 ------------[ cut here ]------------
 kernel BUG at net/core/skbuff.c:116!
 Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
 Call trace:
  skb_panic+0xcc/0xd0
  __skb_checksum+0x0/0x480
  eth_header+0x48/0x1a0
  vlan_dev_hard_header+0xd0/0x284
  neigh_connected_output+0x16c/0x20c
  ip6_finish_output2+0x4b4/0xd74
  __ip6_finish_output.part.0+0x1ac/0x3b0
  ip6_finish_output+0x160/0x200
  ip6_output+0x13c/0x294
  ndisc_send_skb+0x41c/0x6f0
  ndisc_send_rs+0xac/0x3b0
  addrconf_rs_timer+0x42c/0x660
  call_timer_fn+0x54/0x290
  expire_timers+0x26c/0x420

Reproducer
==========

 # Create veth pair (NETIF_F_HW_VLAN_CTAG_TX is ON by default)
 ip link add veth0 type veth peer name veth1
 ip link set veth0 up
 ip link set veth1 up

 # Turn off HW VLAN TX offload on lower device
 ethtool -K veth0 tx-vlan-hw-insert off

 # Create VLAN device on veth0
 # At this point: header_ops = &vlan_header_ops, hard_header_len = 18
 ip link add link veth0 name veth0.10 type vlan id 10 reorder_hdr off
 ip addr add 192.168.10.1/24 dev veth0.10
 ip link set veth0.10 up

 # Turn HW VLAN TX offload back ON on lower device
 # This triggers NETDEV_FEAT_CHANGE -> vlan_transfer_features()
 # hard_header_len changes from 18 to 14, but header_ops is NOT updated
 ethtool -K veth0 tx-vlan-hw-insert on

 # When a packet is sent through veth0.10
 # - skb is allocated based on hard_header_len=14 -> ~16 bytes
 # - vlan_dev_hard_header() pushes VLAN_HLEN(4) + ETH_HLEN(14) = 18 bytes
 # - skb_under_panic!


Any feedback or guidance would be greatly appreciated.

-- 
Best regards,
Tangxin Xie


             reply	other threads:[~2026-07-16 12:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 12:20 xietangxin [this message]
2026-07-16 12:53 ` [BUG] vlan: skb_under_panic when toggling NETIF_F_HW_VLAN_CTAG_TX on lower device Eric Dumazet
2026-07-16 13:06   ` Eric Dumazet
2026-07-17  6:42     ` xietangxin
2026-07-20  7:29       ` Eric Dumazet

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=99d678ae-c7b2-4b44-b534-b8320679deb3@h-partners.com \
    --to=xietangxin@h-partners.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gaoxingwang1@huawei.com \
    --cc=horms@kernel.org \
    --cc=huyizhen2@huawei.com \
    --cc=jesse@nicira.com \
    --cc=john.r.fastabend@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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