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>] [day] [month] [year] [list]
Message-Id: <20230615144942.1020961-1-nik.borisov@suse.com>
Date:   Thu, 15 Jun 2023 17:49:42 +0300
From:   Nikolay Borisov <nik.borisov@...e.com>
To:     x86@...nel.org
Cc:     linux-kernel@...r.kernel.org,
        Nikolay Borisov <nik.borisov@...e.com>
Subject: [PATCH] x86/mce: Use lockdep to assert preemption is off in mcheck_cpu_init

Instead of relying on a comment, use
lockdep_assert_preemption_disabled() as it issue a warning if preemption
is on.

mcheck_cpu_init is called from:

start_kernel
 check_bugs
   identify_boot_cpu
     identify_cpu
       mcheck_cpu_init

Which happens after lockdep_init() call in start_kernel().

Signed-off-by: Nikolay Borisov <nik.borisov@...e.com>
---
 arch/x86/kernel/cpu/mce/core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 2eec60f50057..5d945a1690d5 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -2126,12 +2126,12 @@ DEFINE_IDTENTRY_RAW(exc_machine_check)
 }
 #endif
 
-/*
- * Called for each booted CPU to set up machine checks.
- * Must be called with preempt off:
- */
+/* Called for each booted CPU to set up machine checks. */
 void mcheck_cpu_init(struct cpuinfo_x86 *c)
 {
+
+	lockdep_assert_preemption_disabled();
+
 	if (mca_cfg.disabled)
 		return;
 
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ