From: sashiko-bot@kernel.org
To: "Florian Fainelli" <florian.fainelli@broadcom.com>
Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next 2/9] netfilter: flowtable: reject non-host IPv4 packets before lookup
Date: Tue, 17 Nov 2026 22:33:57 +0000 [thread overview]
Message-ID: <sashiko-outbox-219750@kernel.org> (raw)
In-Reply-To: <20261116222519.1416501-3-florian.fainelli@broadcom.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] netfilter: flowtable: pkt_type check in
nf_flow_offload_ip_hook() breaks bridge and VLAN offload
--
commit 2c508624181706744cfb38cdb730adaefd3aea13
Author: Florian Fainelli <florian.fainelli@broadcom.com>
netfilter: flowtable: reject non-host IPv4 packets before lookup
This commit returns NF_ACCEPT before the flowtable lookup in
nf_flow_offload_ip_hook() when skb->pkt_type is not PACKET_HOST.
> diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
> index 19cafae748abe..98bade1b82994 100644
> --- a/net/netfilter/nf_flow_table_ip.c
> +++ b/net/netfilter/nf_flow_table_ip.c
> @@ -911,6 +911,10 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,
> };
> int ret;
>
> + /* The ingress hook runs before IPv4 rejects non-host Ethernet frames. */
> + if (unlikely(skb->pkt_type != PACKET_HOST))
> + return NF_ACCEPT;
[Severity: High]
Does this break software flowtable offload for bridged and VLAN interfaces
whose MAC address differs from the underlying physical port's MAC?
When a flow is routed over a bridge or VLAN, nft_dev_path_info() binds the
flowtable ingress hook to the underlying physical port. Frames addressed to
the bridge or VLAN MAC arrive on that port with skb->pkt_type set to
PACKET_OTHERHOST by eth_skb_pkt_type().
In __netif_receive_skb_core(), nf_ingress() runs before vlan_do_receive()
and br_handle_frame() promote skb->pkt_type from PACKET_OTHERHOST to
PACKET_HOST:
net/core/dev.c:__netif_receive_skb_core() {
...
if (nf_ingress(skb, &pt_prev, &ret, orig_dev) < 0)
goto out;
...
if (skb_vlan_tag_present(skb)) {
...
if (vlan_do_receive(&skb))
goto another_round;
...
}
rx_handler = rcu_dereference(skb->dev->rx_handler);
}
Because skb->pkt_type is still PACKET_OTHERHOST when nf_flow_offload_ip_hook()
runs, every packet on these flows bypasses the flowtable and falls back to
the slow path.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116222519.1416501-1-florian.fainelli@broadcom.com?part=2
next prev parent reply other threads:[~2026-11-17 22:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 22:25 [PATCH net-next 0/9] net: bgmac: add Northstar IPv4 TCP/UDP NAT flowtable offload Florian Fainelli
2026-11-16 22:25 ` [PATCH net-next 1/9] net: ethernet: bgmac: validate RX length against the DMA packet capacity Florian Fainelli
2026-11-16 22:25 ` [PATCH net-next 2/9] netfilter: flowtable: reject non-host IPv4 packets before lookup Florian Fainelli
2026-11-17 22:33 ` sashiko-bot [this message]
2026-11-16 22:25 ` [PATCH net-next 3/9] netfilter: flowtable: retain offload ownership until deletion completes Florian Fainelli
2026-11-17 22:33 ` sashiko-bot
2026-11-16 22:25 ` [PATCH net-next 4/9] dt-bindings: net: describe the Northstar flow accelerator Florian Fainelli
2026-11-16 22:25 ` [PATCH net-next 5/9] net: dsa: add Broadcom FA metadata and IPv4 exception paths Florian Fainelli
2026-11-17 22:33 ` sashiko-bot
2026-11-16 22:25 ` [PATCH net-next 6/9] net: flow_offload: allow drivers to validate and invalidate cached paths Florian Fainelli
2026-11-16 22:25 ` [PATCH net-next 7/9] net: bgmac: add Northstar IPv4 TCP/UDP NAT flowtable offload Florian Fainelli
2026-11-17 22:33 ` sashiko-bot
2026-11-16 22:25 ` [PATCH net-next 8/9] net: add KUnit coverage for FA and flowtable path validation Florian Fainelli
2026-11-17 22:34 ` sashiko-bot
2026-11-16 22:25 ` [PATCH net-next 9/9] docs: net: document Northstar FA setup and NAT qualification Florian Fainelli
2026-11-16 22:38 ` [PATCH net-next 0/9] net: bgmac: add Northstar IPv4 TCP/UDP NAT flowtable offload netdev-bot+sinfo
2026-11-16 22:45 ` Florian Fainelli
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=sashiko-outbox-219750@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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