Article View: linux.kernel.netdev
Article #440Re: [PATCH] netfilter: ebtables: ebt_802_3: drop short frames before the match reads LLC
From: Guo Zihao
Date: Thu, 08 Oct 2026 02:45
Date: Thu, 08 Oct 2026 02:45
42 lines
7696 bytes
7696 bytes
Hi,
Thanks for the review. All five findings check out against the source,
and I have posted v2 addressing them:
https://lore.kernel.org/netdev/20261008024539.4106699-1-guozh23@xiaopeng.com/
Point by point:
[High] skb_header_pointer() negative offset. Agreed, and I was wrong to
doubt __skb_header_pointer() in v1. v2 now uses
skb_header_pointer(skb, skb_mac_offset(skb), hlen, &_frame)
which covers paged frames as well, instead of my hand-rolled linear-only
check.
[High] The abs(mac_offset) threshold was inconsistent across hooks.
Gone with skb_header_pointer(); the requirement is now expressed as
"bytes from the mac header" and follows whatever the hook did to the
mac header, including the br_send_bpdu() path where mac_offset is 0.
[High] hotdrop silently ignored by ebtables legacy. The match now
returns false instead, the ebt_stp_mt() pattern, so legacy ebtables and
nftables agree again. The commit message also points users who want such
frames dropped at a plain "--802_3 -j DROP" rule rather than hiding a
drop inside a SAP/TYPE check.
[Medium] Reading 23 bytes for a SAP-only rule. v2 reads only
offsetof(struct ebt_802_3_hdr, llc.ui.ctrl) = 16 bytes unless a TYPE
constraint is set, so a 21-byte topology change BPDU still matches
"--802_3 --802_3-sap 0x42 -j ACCEPT" like it did before (the union type
and the control byte are only needed for the TYPE match).
[Low] Fixes tag. v2 carries
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
pw-bot: cr
Guo Zihao
Technical Details
Message-ID:
<20261008024549.4115339-1-guozh23@xiaopeng.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342669-linux-kernel-netdev=dewy.ruReferences:
<179077865471.434549.9648522947578914338@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342669-linux-kernel-netdev=dewy.ru
From: guozh23@xiaopeng.com (Guo Zihao)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] netfilter: ebtables: ebt_802_3: drop short frames before the match reads LLC
Date: Thu, 8 Oct 2026 10:45:49 +0800
Organization: Usenet Network
Message-ID: <20261008024549.4115339-1-guozh23@xiaopeng.com>
References: <179077865471.434549.9648522947578914338@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="787939"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:M21Sh5nZBYaw9ZEy8jrTfTpyxj4= sha256:YTQhtoVi944sAySmOZNKjMBO8Meyl1rtkjBfRIuRdeY=
sha1:Wu9tB/VXjrxx9jkN9YSBlnWqQQE= sha256:tQ5NAGq+HdOuUUNoUImx5OMQbj754eOWL9qUDgPnXPY=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id D712310F2C5; Thu, 8 Oct 2026 05:46:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
header.d=xiaopeng.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id HVIMcYv6ScxC;
Thu, 8 Oct 2026 05:46:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-342669-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=xiaopeng.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 14B4710F24F; Thu, 8 Oct 2026 05:46:07 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by tor.lore.kernel.org (Postfix) with ESMTP id E12E22B659; Thu, 8 Oct 2026 02:46:04 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id E34272931FF;
Thu, 8 Oct 2026 02:46:03 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=xiaopeng.com header.i=@xiaopeng.com header.b="B7bGeyL0"
X-Received: from out28-173.mail.aliyun.com (out28-173.mail.aliyun.com [115.124.28.173])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 551F11A08AF;
Thu, 8 Oct 2026 02:45:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.28.173
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791427563; cv=none; b=SpSn7Gby7qNHXGLWiUKDLE2NsLbUCca1wVDm6OQtgEhkrmgyQBQa8HhAzA9z/KomnDe/mLOTlj7tznQHhl0ZLi2e7kILWFeNDNGIfST3/MbPiyh9/HfKJQU85eFDx3eTQaZFhponJomvrekO7DQLjFfO5jAbi7ufEqD6OVlHJIo=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791427563; c=relaxed/simple;
bh=UfDhaCDDMm7kAZVIqt+mVGPSLmZKVM6WAVVA2x99/M8=;
h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version; b=MT0zWSMOGgqaZeja//OPnruLlkVON4GQGxGTDDCS5PnN3iQEi851SKWz0hkcUHx5qjperBai8/ca1FByg4CAcYE+xy6074DRiUHQTrpSJj5sipE22vRuvMWd2AhP5/xHri79HZRcUmkzT6Qai5b/6D3XEqXxJtdIc3o1XQuHTuA=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xiaopeng.com; spf=pass smtp.mailfrom=xiaopeng.com; dkim=pass (1024-bit key) header.d=xiaopeng.com header.i=@xiaopeng.com header.b=B7bGeyL0; arc=none smtp.client-ip=115.124.28.173
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xiaopeng.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xiaopeng.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=xiaopeng.com; s=default;
t=1791427552; h=From:To:Subject:Date:Message-ID:MIME-Version;
bh=lI1GALVEJrn/SwrfBIlIqj+oyWhvCwuNikjGXJLM/cc=;
b=B7bGeyL0Sjt9ituliz5YB4DxXk1uRUCnOwYwbXchZEESertJtD1cbQPeQsY1qG+BQ+60OMH2TjLlthgQWCGEMbQHm/jYC4Q65zGkJTieqOoz4cAoyQXxobj3RrZuk2CVtdt5pJiiHFzdrXXnc360aYdmfylDvoKGRIMl0LfrT+w=
X-Alimail-AntiSpam: AC=CONTINUE;BC=0.08667126|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.141551-0.00588351-0.852565;FP=18319517013567864945|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033032053168;MF=guozh23@xiaopeng.com;NM=1;PH=DS;RN=16;RT=16;SR=0;TI=SMTPD_---.jWKvv6R_1791427549;
X-Received: from localhost(mailfrom:guozh23@xiaopeng.com fp:SMTPD_---.jWKvv6R_1791427549 cluster:ay29)
by smtp.aliyun-inc.com;
Thu, 08 Oct 2026 10:45:50 +0800
X-Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
Florian Westphal <fw@strlen.de>,
Phil Sutter <phil@nwl.cc>,
Nikolay Aleksandrov <razor@blackwall.org>,
Ido Schimmel <idosch@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netfilter-devel@vger.kernel.org,
coreteam@netfilter.org,
bridge@lists.linux.dev,
netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.50.1
X-In-Reply-To: <179077865471.434549.9648522947578914338@kernel.org>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>