]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/sched: initialize noop_qdisc owner
authorJohannes Berg <johannes.berg@intel.com>
Fri, 7 Jun 2024 15:53:32 +0000 (17:53 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 11 Jun 2024 02:36:49 +0000 (19:36 -0700)
When the noop_qdisc owner isn't initialized, then it will be 0,
so packets will erroneously be regarded as having been subject
to recursion as long as only CPU 0 queues them. For non-SMP,
that's all packets, of course. This causes a change in what's
reported to userspace, normally noop_qdisc would drop packets
silently, but with this change the syscall returns -ENOBUFS if
RECVERR is also set on the socket.

Fix this by initializing the owner field to -1, just like it
would be for dynamically allocated qdiscs by qdisc_alloc().

Fixes: 0f022d32c3ec ("net/sched: Fix mirred deadlock on device recursion")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240607175340.786bfb938803.I493bf8422e36be4454c08880a8d3703cea8e421a@changeid
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_generic.c

index 2a637a17061b91fe8e534823a8b031699bb64f4a..e22ff003d52ee8ad9e3c81f7b81680baf6b60d37 100644 (file)
@@ -676,6 +676,7 @@ struct Qdisc noop_qdisc = {
                .qlen = 0,
                .lock = __SPIN_LOCK_UNLOCKED(noop_qdisc.skb_bad_txq.lock),
        },
+       .owner = -1,
 };
 EXPORT_SYMBOL(noop_qdisc);