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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <2042051.3vvUWIM0vs@hex>
Date:   Tue, 13 Sep 2016 16:27:05 +1000
From:   Con Kolivas <kernel@...ivas.org>
To:     linux-kernel@...r.kernel.org
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Alfred Chen <cchalpha@...il.com>,
        Ingo Molnar <mingo@...hat.com>
Subject: [PATCH] sched: Do not use smp_processor_id() with preempt enabled in smpboot_thread_fn

We should not be using smp_processor_id() with preempt enabled.

Bug identified and fix provided by Alfred Chen.

Signed-off-by: Con Kolivas <kernel@...ivas.org>

---
 kernel/smpboot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-4.7.3-ck3/kernel/smpboot.c
===================================================================
--- linux-4.7.3-ck3.orig/kernel/smpboot.c	2016-05-16 08:43:13.000000000 +1000
+++ linux-4.7.3-ck3/kernel/smpboot.c	2016-09-13 16:17:33.535655129 +1000
@@ -122,12 +122,12 @@ static int smpboot_thread_fn(void *data)
 
 		if (kthread_should_park()) {
 			__set_current_state(TASK_RUNNING);
-			preempt_enable();
 			if (ht->park && td->status == HP_THREAD_ACTIVE) {
 				BUG_ON(td->cpu != smp_processor_id());
 				ht->park(td->cpu);
 				td->status = HP_THREAD_PARKED;
 			}
+			preempt_enable();
 			kthread_parkme();
 			/* We might have been woken for stop */
 			continue;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ