Re: [syzbot] [net?] possible deadlock in sch_direct_xmit

From: syzbot
Date: Sun Nov 26 2023 - 01:52:36 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.

***

Subject: [net?] possible deadlock in sch_direct_xmit
Author: eadavis@xxxxxx

please test deadlock in sch_direct_xmit

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 4195a4bc26ca..4605314e605e 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -338,8 +338,11 @@ bool sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,

if (likely(skb)) {
HARD_TX_LOCK(dev, txq, smp_processor_id());
- if (!netif_xmit_frozen_or_stopped(txq))
+ if (!netif_xmit_frozen_or_stopped(txq)) {
+ netif_tx_stop_queue(txq);
skb = dev_hard_start_xmit(skb, dev, txq, &ret);
+ netif_tx_start_queue(txq);
+ }
else
qdisc_maybe_clear_missed(q, txq);