lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0000000000006d859a060b212e83@google.com>
Date:   Mon, 27 Nov 2023 04:10:00 -0800
From:   syzbot <syzbot+e18ac85757292b7baf96@...kaller.appspotmail.com>
To:     linux-kernel@...r.kernel.org
Subject: Re: [syzbot] [net?] possible deadlock in sch_direct_xmit

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

***

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

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..9e418f94757d 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -337,13 +337,16 @@ bool sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
 #endif
 
 	if (likely(skb)) {
-		HARD_TX_LOCK(dev, txq, smp_processor_id());
-		if (!netif_xmit_frozen_or_stopped(txq))
-			skb = dev_hard_start_xmit(skb, dev, txq, &ret);
-		else
-			qdisc_maybe_clear_missed(q, txq);
+		int cpu = smp_processor_id();
+		if (READ_ONCE(txq->xmit_lock_owner) != cpu) {
+			HARD_TX_LOCK(dev, txq, cpu);
+			if (!netif_xmit_frozen_or_stopped(txq))
+				skb = dev_hard_start_xmit(skb, dev, txq, &ret);
+			else
+				qdisc_maybe_clear_missed(q, txq);
 
-		HARD_TX_UNLOCK(dev, txq);
+			HARD_TX_UNLOCK(dev, txq);
+		}
 	} else {
 		if (root_lock)
 			spin_lock(root_lock);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ