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] [thread-next>] [day] [month] [year] [list]
Date: Thu,  4 Apr 2024 08:00:49 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+e29c204bd2e3906fe69c@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
	syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [net?] [nfc?] WARNING: locking bug in nci_close_device (2)

On Wed, 03 Apr 2024 12:49:25 -0700
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    fe46a7dd189e Merge tag 'sound-6.9-rc1' of git://git.kernel..
> git tree:       upstream
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1201b6d3180000

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

--- x/net/nfc/nci/core.c
+++ y/net/nfc/nci/core.c
@@ -560,7 +560,8 @@ static int nci_close_device(struct nci_d
 	 */
 	mutex_lock(&ndev->req_lock);
 
-	if (!test_and_clear_bit(NCI_UP, &ndev->flags)) {
+	if (!test_and_clear_bit(NCI_UP, &ndev->flags) &&
+	    !test_bit(NCI_UNREG +1, &ndev->flags)) {
 		/* Need to flush the cmd wq in case
 		 * there is a queued/running cmd_work
 		 */
@@ -601,6 +602,7 @@ static int nci_close_device(struct nci_d
 
 	/* Clear flags except NCI_UNREG */
 	ndev->flags &= BIT(NCI_UNREG);
+	set_bit(NCI_UNREG +1, &ndev->flags);
 
 	mutex_unlock(&ndev->req_lock);
 
--

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ