From: netdev-bot+sashiko@kernel.org
To: jhs@mojatatu.com
Cc: netdev@vger.kernel.org, victor@mojatatu.com, jiri@resnulli.us,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, stable@vger.kernel.org,
sashiko-bot@kernel.org
Subject: Re: [PATCH net v5 3/3] net/sched: sch_teql: keep skb->dev consistent on the arp-queue path
Date: Thu, 19 Nov 2026 10:38:40 +0000 [thread overview]
Message-ID: <179508472073.3136.1625322377662676881@kernel.org> (raw)
In-Reply-To: <QDISC-6HS9.v5.r0.20261116052927-3@mojatatu.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The patch carries `Cc: stable@vger.kernel.org` and only works
if a net/core/neighbour.c fix is applied first, but the commit message…
- [Medium] The ICMP error for a failed neighbour resolution is now routed
in the teql slave's L3 context instead of the master's.
--
net/sched: sch_teql: keep skb->dev consistent on the arp-queue path
This patch moves the skb->dev = slave assignment in teql_master_xmit() so
that it happens before teql_resolve(). An skb parked on the slave's
arp_queue then names the slave instead of the teql master. This avoids a
use-after-free when sch_teql is unloaded and the master is freed while the
skb is still queued.
Link: https://lore.kernel.org/netdev/20260824115928.4099988-1-victor@mojatatu.com/
Link: https://lore.kernel.org/netdev/20261026160747.283702-1-horms@kernel.org/
Link: https://lore.kernel.org/netdev/20261031165925.780930-1-horms@kernel.org/
Link: https://lore.kernel.org/netdev/179363700308.3131.11778179538290251434@kernel.org/
Link: https://lore.kernel.org/netdev/20261110101908.2e64e8e9@kernel.org/
> A parked skb is reinjected by neigh_update_process_arp_queue(), and a
> device that transmits straight on skb->dev has to be handed its skb back
> there. That is a change to net/core/neighbour.c, posted as its own fix,
> and it has to be applied before this one: without it the parked packet
> leaves the slave directly, with no link header, because teql_master_xmit()
> has already pulled it.
[ ... ]
> Cc: stable@vger.kernel.org
[Severity: Medium]
This patch carries Cc: stable, so could the prerequisite be named
explicitly? The text only says the neighbour.c change is "posted as its
own fix". It gives no commit id, subject or Link, and the stable tag has no
"# depends on" note.
The prerequisite looks like "net: neighbour: reinject a parked skb through
a headerless output device". It adds this to
neigh_update_process_arp_queue():
/* headerless output transmits on skb->dev, not n1->dev */
if (!n1->dev->header_ops)
skb->dev = n1->dev;
READ_ONCE(n1->output)(n1, skb);
neigh_update_process_arp_queue() was only split out of __neigh_update() by
commit 705ef89ac98648 ("net: core: neighbour: Extract ARP queue processing
to a helper function"). So the neighbour fix will not apply cleanly to
older stable trees.
This sch_teql hunk is a one-line move. Given the earlier sch_teql patch
that adds the &hlen argument, it would apply to those trees on its own.
If this patch reaches a stable tree without the neighbour fix, would an skb
parked on the slave's arp_queue go out with no link header?
When the neighbour resolves, neigh_update_process_arp_queue() looks up n1
again from the dst and gets the teql master's neighbour. The master has no
header_ops, so n1->output is neigh_direct_output(). That transmits on
skb->dev, which is now the slave:
neigh_update_process_arp_queue()
n1->output() == neigh_direct_output()
dev_queue_xmit(skb) /* skb->dev == slave, header already pulled */
Would something like "Cc: stable@vger.kernel.org # depends on <commit>"
help keep the two patches together?
> diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
> index 626dc001ec231..e60d8f3b127de 100644
> --- a/net/sched/sch_teql.c
> +++ b/net/sched/sch_teql.c
> @@ -374,13 +374,13 @@ static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
> continue;
> }
>
> + skb->dev = slave;
> switch (teql_resolve(skb, skb_res, slave, slave_txq, &hlen)) {
[Severity: Medium]
skb->dev is now set to the slave before teql_resolve(). So when
__teql_resolve()->neigh_event_send() parks the skb, skb->dev is the slave
while skb_dst(skb)->dev is still the master.
Does this change the L3 context used to route the ICMP error when
resolution fails?
neigh_invalidate()
arp_error_report() / ndisc_error_report()
dst_link_failure()
For IPv4, the path is
ipv4_link_failure()->ipv4_send_dest_unreach()->__icmp_send()->icmp_route_lookup().
icmp_route_lookup() calls icmp_get_route_lookup_dev(), which prefers
skb->dev:
route_lookup_dev = icmp_get_route_lookup_dev(skb_in);
fl4->flowi4_oif = l3mdev_master_ifindex(route_lookup_dev);
So the oif and the inet_addr_type_dev_table() checks now come from the
slave rather than the master.
For IPv6, icmp6_send() takes iif from skb->dev:
if (__ipv6_addr_needs_scope_id(addr_type)) {
iif = icmp6_iif(skb);
} else {
...
iif = l3mdev_master_ifindex(skb->dev);
}
icmp6_dev() only falls back to the dst device for loopback or l3 master
devices, so the slave is used as is.
A teql master can be enslaved to a VRF, since vrf_add_slave() only rejects
l3 masters, existing l3 slaves and loopback. The slave is normally not in
the VRF.
In that setup, the host-unreachable error would now be looked up with
oif 0 in the main tables, not in the VRF table that holds the master's
address. Could it then fail routing, or follow a main-table default route
off the box?
The same seems to apply to an IPv6 link-local source on the master. There
the strict oif=slave lookup would not match the master's local route.
Without a VRF and with global addresses, l3mdev_master_ifindex() is 0 for
both devices, so nothing changes in that case.
The commit message says the error path "names the slave on that path too".
It does not mention this change in routing context. Is it intended?
> case 0:
> if (__netif_tx_trylock(slave_txq)) {
> unsigned int length = qdisc_pkt_len(skb);
> int rc = NETDEV_TX_BUSY;
>
> - skb->dev = slave;
> if (!netif_xmit_frozen_or_stopped(slave_txq))
> rc = netdev_start_xmit(skb, slave, slave_txq, false);
> __netif_tx_unlock(slave_txq);
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/QDISC-6HS9.v5.r0.20261116052927%40mojatatu.com
prev parent reply other threads:[~2026-11-19 10:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 10:36 [PATCH net v5 0/3] net/sched: sch_teql: keep the transmit path's skb geometry and device lifetime intact Jamal Hadi Salim
2026-11-16 10:36 ` [PATCH net v5 1/3] net/sched: sch_teql: unshare the header before writing and fix retry strip Jamal Hadi Salim
2026-11-19 10:38 ` netdev-bot+sashiko
2026-11-16 10:36 ` [PATCH net v5 2/3] net: neighbour: reinject a parked skb through a headerless output device Jamal Hadi Salim
2026-11-19 10:38 ` netdev-bot+sashiko
2026-11-16 10:36 ` [PATCH net v5 3/3] net/sched: sch_teql: keep skb->dev consistent on the arp-queue path Jamal Hadi Salim
2026-11-19 10:38 ` netdev-bot+sashiko [this message]
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=179508472073.3136.1625322377662676881@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sashiko-bot@kernel.org \
--cc=stable@vger.kernel.org \
--cc=victor@mojatatu.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