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-next>] [day] [month] [year] [list]
Date:   Tue, 15 Oct 2019 09:16:57 -0700
From:   Davidlohr Bueso <dave@...olabs.net>
To:     herbert@...dor.apana.org.au
Cc:     linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
        dave@...olabs.net, Davidlohr Bueso <dbueso@...e.de>
Subject: [PATCH] drivers,crypto/cavium: Fix barrier barrier usage after atomic_set()

Because it is not a Rmw operation, atomic_set() is not serialized,
and therefore the 'upgradable' smp_mb__after_atomic() call after
the atomic_set() is completely bogus (not to mention the comment
could also use some love, but that's a different matter).

This patch replaces these with smp_mb(), which seems like the
original intent of when the code was written.

Signed-off-by: Davidlohr Bueso <dbueso@...e.de>
---
 drivers/crypto/cavium/nitrox/nitrox_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/cavium/nitrox/nitrox_main.c b/drivers/crypto/cavium/nitrox/nitrox_main.c
index bc924980e10c..da2e0edceb50 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_main.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_main.c
@@ -504,7 +504,7 @@ static int nitrox_probe(struct pci_dev *pdev,
 
 	atomic_set(&ndev->state, __NDEV_READY);
 	/* barrier to sync with other cpus */
-	smp_mb__after_atomic();
+	smp_mb();
 
 	err = nitrox_crypto_register();
 	if (err)
@@ -551,7 +551,7 @@ static void nitrox_remove(struct pci_dev *pdev)
 
 	atomic_set(&ndev->state, __NDEV_NOT_READY);
 	/* barrier to sync with other cpus */
-	smp_mb__after_atomic();
+	smp_mb();
 
 	nitrox_remove_from_devlist(ndev);
 
-- 
2.16.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ