public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 net 0/2] net: vlan: fix skb_panic bug in vlan_dev_hard_header()
@ 2026-01-07  3:34 Chen Zhen
  2026-01-07  3:34 ` [PATCH v2 net 1/2] net: vlan: set header_ops to match hard_header_len when hw offload is toggled Chen Zhen
  2026-01-07  3:34 ` [PATCH v2 net 2/2] selftests: vlan: add test for turn on hw offload with reorder_hdr off Chen Zhen
  0 siblings, 2 replies; 4+ messages in thread
From: Chen Zhen @ 2026-01-07  3:34 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, horms
  Cc: netdev, linux-kernel, huyizhen2, gaoxingwang1

This series fix a skb_panic bug in vlan_dev_hard_header().

If a vlan device with reorder_hdr off is created without hw offload
feature, but up with hw offload on, the ndisc skb has no enough
room for vlan hdr in vlan_dev_hard_header() and finally panic.

The first patch fixes the bug itself by also setting header_ops of
vlan dev when offload feature is toggled. The second patch adds a
regression test for this bug.

---
v1 -> v2:
- Address format issues of commit message
- Add a selftest to catch re-occurrence of this issue as suggested by Jakub
- v1: https://lore.kernel.org/all/20251231035419.23422-1-chenzhen126@huawei.com/

Chen Zhen (2):
  net: vlan: set header_ops to match hard_header_len when hw offload is
    toggled
  selftests: vlan: add test for turn on hw offload with reorder_hdr off

 net/8021q/vlan.c                              |  5 +---
 net/8021q/vlan.h                              |  3 ++
 net/8021q/vlan_dev.c                          | 22 +++++++++-----
 tools/testing/selftests/net/Makefile          |  1 +
 .../testing/selftests/net/vlan_hw_offload.sh  | 30 +++++++++++++++++++
 5 files changed, 49 insertions(+), 12 deletions(-)
 create mode 100755 tools/testing/selftests/net/vlan_hw_offload.sh

-- 
2.33.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-09 17:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07  3:34 [PATCH v2 net 0/2] net: vlan: fix skb_panic bug in vlan_dev_hard_header() Chen Zhen
2026-01-07  3:34 ` [PATCH v2 net 1/2] net: vlan: set header_ops to match hard_header_len when hw offload is toggled Chen Zhen
2026-01-07  3:34 ` [PATCH v2 net 2/2] selftests: vlan: add test for turn on hw offload with reorder_hdr off Chen Zhen
2026-01-09 17:52   ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox