Skip to content

Commit

Permalink
net/sched: initialize noop_qdisc owner
Browse files Browse the repository at this point in the history
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: 0f022d3 ("net/sched: Fix mirred deadlock on device recursion")
Signed-off-by: Johannes Berg <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Link: https://lore.kernel.org/r/20240607175340.786bfb938803.I493bf8422e36be4454c08880a8d3703cea8e421a@changeid
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
jmberg-intel authored and kuba-moo committed Jun 11, 2024
1 parent 9379213 commit 44180fe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 44180fe

Please sign in to comment.