From: Chen Zhen <chenzhen126@huawei.com>
To: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <horms@kernel.org>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<huyizhen2@huawei.com>, <gaoxingwang1@huawei.com>
Subject: [PATCH v4 net 0/2] net: vlan: fix skb_panic bug in vlan_dev_hard_header()
Date: Mon, 26 Jan 2026 12:04:24 +0800 [thread overview]
Message-ID: <20260126040426.2570396-1-chenzhen126@huawei.com> (raw)
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 always set hard_header_len with
VLAN_HLEN. The second patch adds a regression test for this bug.
---
v3 -> v4:
- Change the fix method to cover other callers as suggested by Eric, thx!
- v3: https://lore.kernel.org/all/20260112075939.2509397-1-chenzhen126@huawei.com/
v2 -> v3:
- Add a comment to test script to silence shellcheck SC2329 warning
- v2: https://lore.kernel.org/all/20260107033423.1885071-1-chenzhen126@huawei.com/
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: always set hard_header_len with VLAN_HLEN
selftests: vlan: add test for turn on hw offload with reorder_hdr off
net/8021q/vlan.c | 5 ---
net/8021q/vlan_dev.c | 8 ++---
tools/testing/selftests/net/Makefile | 1 +
.../testing/selftests/net/vlan_hw_offload.sh | 31 +++++++++++++++++++
4 files changed, 35 insertions(+), 10 deletions(-)
create mode 100755 tools/testing/selftests/net/vlan_hw_offload.sh
--
2.33.0
next reply other threads:[~2026-01-26 3:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 4:04 Chen Zhen [this message]
2026-01-26 4:04 ` [PATCH v4 net 1/2] net: vlan: always set hard_header_len with VLAN_HLEN Chen Zhen
2026-01-29 11:08 ` Paolo Abeni
2026-01-26 4:04 ` [PATCH v4 net 2/2] selftests: vlan: add test for turn on hw offload with reorder_hdr off Chen Zhen
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=20260126040426.2570396-1-chenzhen126@huawei.com \
--to=chenzhen126@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gaoxingwang1@huawei.com \
--cc=horms@kernel.org \
--cc=huyizhen2@huawei.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
all inboxes | Powered by JetHome®