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:   Tue, 19 Sep 2017 15:46:48 +0300
From:   Andrey Ryabinin <aryabinin@...tuozzo.com>
To:     Dmitry Vyukov <dvyukov@...gle.com>
Cc:     akpm@...ux-foundation.org,
        Andrey Konovalov <andreyknvl@...gle.com>, tchibo@...gle.com,
        syzkaller@...glegroups.com, Mark Rutland <mark.rutland@....com>,
        linux-kernel@...r.kernel.org,
        Andrey Ryabinin <aryabinin@...tuozzo.com>
Subject: [PATCH 3/3] kcov: remove useless barrier()s

As comment says barriers needed for preempt_schedule_irq() case
where in_interrupt() returns false. But we don't use in_interrupt()
since b274c0bb394c ("kcov: properly check if we are in an interrupt").

Now we use in_task() which handles preempt_schedule_irq() case properly,
thus no barrier required.

Signed-off-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
---
 kernel/kcov.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/kernel/kcov.c b/kernel/kcov.c
index 14cc8c1a7cad..b7fbcbef88c1 100644
--- a/kernel/kcov.c
+++ b/kernel/kcov.c
@@ -71,14 +71,6 @@ void notrace __sanitizer_cov_trace_pc(void)
 
 		ip -= kaslr_offset();
 
-		/*
-		 * There is some code that runs in interrupts but for which
-		 * in_interrupt() returns false (e.g. preempt_schedule_irq()).
-		 * READ_ONCE()/barrier() effectively provides load-acquire wrt
-		 * interrupts, there are paired barrier()/WRITE_ONCE() in
-		 * kcov_ioctl_locked().
-		 */
-		barrier();
 		area = t->kcov_area;
 		/* The first word is number of subsequent PCs. */
 		pos = READ_ONCE(area[0]) + 1;
@@ -228,8 +220,6 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd,
 		/* Cache in task struct for performance. */
 		t->kcov_size = kcov->size;
 		t->kcov_area = kcov->area;
-		/* See comment in __sanitizer_cov_trace_pc(). */
-		barrier();
 		WRITE_ONCE(t->kcov_mode, kcov->mode);
 		t->kcov = kcov;
 		kcov->t = t;
-- 
2.13.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ