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]
Date:   Thu, 13 Aug 2020 13:00:17 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     peterz@...radead.org
Cc:     Christoph Hellwig <hch@...radead.org>,
        Jacob Wen <jian.w.wen@...cle.com>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: insert a general SMP memory barrier before
 wake_up_bit()

On Thu, Aug 13, 2020 at 01:40:50PM +0200, peterz@...radead.org wrote:
> On Thu, Aug 13, 2020 at 08:31:15AM +0100, Christoph Hellwig wrote:
> > On Thu, Aug 13, 2020 at 10:44:38AM +0800, Jacob Wen wrote:
> > > wake_up_bit() uses waitqueue_active() that needs the explicit smp_mb().
> > 
> > Sounds like the barrier should go into wake_up_bit then..
> 
> Oh, thanks for reminding me..
> 
> https://lkml.kernel.org/r/20190624165012.GH3436@hirez.programming.kicks-ass.net
> 
> I'll try and get back to that.

+++ b/drivers/bluetooth/btmtkuart.c
@@ -340,11 +340,8 @@ static int btmtkuart_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
 
 	if (hdr->evt == HCI_EV_VENDOR) {
 		if (test_and_clear_bit(BTMTKUART_TX_WAIT_VND_EVT,
-				       &bdev->tx_state)) {
-			/* Barrier to sync with other CPUs */
-			smp_mb__after_atomic();
+				       &bdev->tx_state))
 			wake_up_bit(&bdev->tx_state, BTMTKUART_TX_WAIT_VND_EVT);
-		}
 	}
 
 	return 0;

It'd be nice to be able to write:

	if (hdr->evt == HCI_EV_VENDOR)
		test_clear_and_wake_up_bit(&bdev->tx_state,
						BTMTKUART_TX_WAIT_VND_EVT);

... maybe with a better name.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ