From: Simon Horman <horms@kernel.org>
To: xiexinet@gmail.com
Cc: Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com,
wsa+renesas@sang-engineering.com, jie.luo@oss.qualcomm.com,
shuah@kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, fmancera@suse.de,
bigeasy@linutronix.de, fmaurer@redhat.com, luka.gejak@linux.dev
Subject: Re: [PATCH net-next v4 1/4] net: hsr: add PRP interlink (RedBox) datapath and duplicate discard
Date: Fri, 24 Jul 2026 14:12:30 +0100 [thread overview]
Message-ID: <20260724131230.679892-1-horms@kernel.org> (raw)
In-Reply-To: <20260717201457.54-2-xiexinet@gmail.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
Full review at: https://sashiko.dev/#/patchset/20260717201457.54-2-xiexinet@gmail.com?part=1
---
--- Patch [1]: [PATCH net-next v4 1/4] net: hsr: add PRP interlink (RedBox) datapath and duplicate discard ---
commit 56647cd99caab3cbc966d1e4d258db2aadbec967
Author: Xin Xie <xiexinet@gmail.com>
net: hsr: add PRP interlink (RedBox) datapath and duplicate discard
This commit adds PRP interlink forwarding rules to prp_drop_frame() and gives
RedBox nodes a second duplicate-discard slot. It also publishes the RedBox
state before the first hsr_add_port() to prevent sequence state sizing issues.
> diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
> index 0774981a65c16..7734a521a96c2 100644
> --- a/net/hsr/hsr_forward.c
> +++ b/net/hsr/hsr_forward.c
> @@ -440,12 +440,34 @@ static int hsr_xmit(struct sk_buff *skb, struct hsr_port *port,
> return dev_queue_xmit(skb);
> }
[Severity: High]
This isn't a bug introduced by this patch, but does modifying the MAC header
directly in hsr_xmit() corrupt shared packet data?
When an HSR frame is received from a slave port, it is forwarded to both the
master and interlink ports. Both ports receive a cloned skb that shares the
same underlying data buffer.
If we look at hsr_xmit(), the source MAC is modified directly:
net/hsr/hsr_forward.c:hsr_xmit() {
...
if (port->type == HSR_PT_INTERLINK)
ether_addr_copy(eth_hdr(skb)->h_source,
port->hsr->macaddress_redbox);
...
}
At the same time, hsr_deliver_master() modifies the source MAC on its clone
before delivering to the local stack via netif_rx().
Since both clones share the same buffer, does this overwrite the exact same
memory and corrupt the packet data for whichever interface gets queued first?
Should the skb be unshared before making these direct modifications?
Similarly, does hsr_create_tagged_frame() have the same issue when it
modifies the HSR tag path_id directly on frame->skb_hsr (the original
received packet)?
Since this path is triggered by incoming frames destined for the Redbox from
the network, can this reliable data corruption be reached by unprivileged
remote input?
next prev parent reply other threads:[~2026-07-24 13:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 20:14 [PATCH net-next v4 0/4] net: hsr: PRP RedBox (PRP-SAN) support Xin Xie
2026-07-17 20:14 ` [PATCH net-next v4 1/4] net: hsr: add PRP interlink (RedBox) datapath and duplicate discard Xin Xie
2026-07-24 13:12 ` Simon Horman [this message]
2026-07-17 20:14 ` [PATCH net-next v4 2/4] net: hsr: emit RedBox-MAC TLV in PRP RedBox supervision frames Xin Xie
2026-07-17 20:14 ` [PATCH net-next v4 3/4] net: hsr: allow PRP RedBox (interlink) creation Xin Xie
2026-07-24 13:12 ` Simon Horman
2026-07-17 20:14 ` [PATCH net-next v4 4/4] selftests: net: hsr: add PRP RedBox test Xin Xie
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=20260724131230.679892-1-horms@kernel.org \
--to=horms@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fmancera@suse.de \
--cc=fmaurer@redhat.com \
--cc=jie.luo@oss.qualcomm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=luka.gejak@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=xiexinet@gmail.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