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]
Message-ID: <tip-bd9f943e5d2a42d864f9692477a25034c9d47dcc@git.kernel.org>
Date:   Mon, 30 Jul 2018 10:37:22 -0700
From:   tip-bot for Pavel Tatashin <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     peterz@...radead.org, mingo@...nel.org, linux@...ck-us.net,
        tglx@...utronix.de, pasha.tatashin@...cle.com,
        linux-kernel@...r.kernel.org, hpa@...or.com
Subject: [tip:x86/timers] sched/clock: Disable interrupts when calling
 generic_sched_clock_init()

Commit-ID:  bd9f943e5d2a42d864f9692477a25034c9d47dcc
Gitweb:     https://git.kernel.org/tip/bd9f943e5d2a42d864f9692477a25034c9d47dcc
Author:     Pavel Tatashin <pasha.tatashin@...cle.com>
AuthorDate: Mon, 30 Jul 2018 09:52:52 -0400
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Mon, 30 Jul 2018 19:33:35 +0200

sched/clock: Disable interrupts when calling generic_sched_clock_init()

sched_clock_init() used be called early during boot when interrupts were
still disabled. After the recent changes to utilize sched clock early the
sched_clock_init() call happens when interrupts are already enabled, which
triggers the following warning:

WARNING: CPU: 0 PID: 0 at kernel/time/sched_clock.c:180 sched_clock_register+0x44/0x278
[<c001a13c>] (warn_slowpath_null) from [<c052367c>] (sched_clock_register+0x44/0x278)
[<c052367c>] (sched_clock_register) from [<c05238d8>] (generic_sched_clock_init+0x28/0x88)
[<c05238d8>] (generic_sched_clock_init) from [<c0521a00>] (sched_clock_init+0x54/0x74)
[<c0521a00>] (sched_clock_init) from [<c0519c18>] (start_kernel+0x310/0x3e4)
[<c0519c18>] (start_kernel) from [<00000000>] (  (null))

Disable IRQs for the duration of generic_sched_clock_init().

Fixes: 857baa87b642 ("sched/clock: Enable sched clock early")
Signed-off-by: Pavel Tatashin <pasha.tatashin@...cle.com>
Reported-by: Guenter Roeck <linux@...ck-us.net>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: steven.sistare@...cle.com
Cc: daniel.m.jordan@...cle.com
Link: https://lkml.kernel.org/r/20180730135252.24599-1-pasha.tatashin@oracle.com
---
 kernel/sched/clock.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index 811a39aca1ce..e3e3b979f9bd 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -452,7 +452,9 @@ EXPORT_SYMBOL_GPL(sched_clock_idle_wakeup_event);
 void __init sched_clock_init(void)
 {
 	static_branch_inc(&sched_clock_running);
+	local_irq_disable();
 	generic_sched_clock_init();
+	local_irq_enable();
 }
 
 u64 sched_clock_cpu(int cpu)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ