mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cheng Yongkang <teel4res@gmail.com>
To: Nikolay Aleksandrov <razor@blackwall.org>,
	Ido Schimmel <idosch@nvidia.com>
Cc: Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	bridge@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [BUG] net: bridge: DSA LAG self-match leaves hwdom zero
Date: Thu, 22 Oct 2026 02:07:06 -0700	[thread overview]
Message-ID: <20261022090706.3643840-1-teel4res@gmail.com> (raw)

Hi all,

When a DSA LAG member joins a bond that is already present in
br->port_list, nbp_switchdev_hwdom_set() can iterate over the joining
port itself.  The self-match leaves hwdom at the unassigned sentinel 0
while the port is marked offloaded and tx_fwd_offload is enabled.
No busy_hwdoms bit is reserved.

DSA frames may still carry offload_fwd_mark.  If another port also has
hwdom 0, nbp_switchdev_allowed_egress() treats the two ports as the
same hardware domain, so an otherwise valid forwarded frame is
suppressed at bridge egress.

Observed on Linux v7.3, commit
08ab31164c55f20c7a2653de3186ae333470e2c1.  The exact DSA LAG route ran:

  dsa_port_lag_join
  dsa_port_bridge_join
  switchdev_bridge_port_offload

After the join:

  offload_count=1 hwdom=0 busy_hwdoms=0 tx_fwd_offload=1

With a second port using a different switch parent ID and also left at
hwdom 0:

  unmarked control frame:                 delivered 8/8
  identical frame with offload_fwd_mark=1: delivered 0/8

The result repeated with two independent netdevsim switch IDs.  There
was no KASAN report, oops, or panic; the defect is packet suppression.

The target bridge and DSA core code were unchanged.  The test VM has no
physical DSA driver, so an in-tree dsa_loop build was exposed as an
external module with only port_lag_join/port_lag_leave and
tx_fwd_offload behavior.  A diagnostic hook set the same
offload_fwd_mark bit a hardware switch would set.

hwdom allocation must exclude the joining port, or publication must
occur only after a nonzero domain is reserved.  Candidate BR-031 is a
different error-path leak in the same bridge switchdev code, not a
duplicate of this packet path.

I found no matching self-match allocation fix.  A 2024 generic
offload_fwd_mark/hwdom-0 comparison patch is also absent from the target
source, but that patch does not fix the unassigned-domain state created
here.

The module sources, PoC, and full logs are available on request.

This was found with AI-assisted source analysis and fuzzing; the
packet-drop differential was reproduced in QEMU.

Thanks,
Cheng Yongkang

                 reply	other threads:[~2026-10-22  9:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261022090706.3643840-1-teel4res@gmail.com \
    --to=teel4res@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=bridge@lists.linux.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    /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®