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:   Fri, 24 Mar 2017 11:14:52 +0100
From:   Emilio Cobos Álvarez <emilio@...sal.io>
To:     linux-kernel@...r.kernel.org, Benjamin LaHaise <bcrl@...ck.org>,
        linux-aio@...ck.org
Cc:     Emilio Cobos Álvarez <emilio@...sal.io>
Subject: [PATCH 2/2] fs/aio.c: use READ_ONCE instead of ACCESS_ONCE for kiocb->ki_cancel

This is suggested by checkpath, but thought that wasn't as trivial as the
previous patch and deserved a bit more thought.

AIUI, this should prevent the compiler reordering the assignment in the same
way, so let's just use it.

Signed-off-by: Emilio Cobos Álvarez <emilio@...sal.io>
---
 fs/aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/aio.c b/fs/aio.c
index be0ca6d9a6b3..dce62ed78c5c 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -578,7 +578,7 @@ static int kiocb_cancel(struct aio_kiocb *kiocb)
 	 * actually has a cancel function, hence the cmpxchg()
 	 */
 
-	cancel = ACCESS_ONCE(kiocb->ki_cancel);
+	cancel = READ_ONCE(kiocb->ki_cancel);
 	do {
 		if (!cancel || cancel == KIOCB_CANCELLED)
 			return -EINVAL;
-- 
2.12.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ