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: <20250516231858.27899-1-ebiggers@kernel.org>
Date: Fri, 16 May 2025 16:18:55 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: x86@...nel.org
Cc: linux-kernel@...r.kernel.org,
	linux-crypto@...r.kernel.org,
	linux-pm@...r.kernel.org,
	Borislav Petkov <bp@...en8.de>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ayush Jain <Ayush.Jain3@....com>,
	Herbert Xu <herbert@...dor.apana.org.au>,
	Ard Biesheuvel <ardb@...nel.org>
Subject: [PATCH 0/3] x86: Don't support kernel-mode FPU with hardirqs disabled

This series returns to my earlier suggestion to make x86 not support
kernel-mode FPU when hardirqs are disabled, aligning it with arm64
(https://lore.kernel.org/r/20250220051325.340691-2-ebiggers@kernel.org).
To make this possible despite the use of the kernel-mode FPU functions
by __save_processor_state() (which I mentioned at
https://lore.kernel.org/r/20250228035924.GC5588@sol.localdomain), I've
changed __save_processor_state() to use a new function instead of
(mis)using the kernel-mode FPU functions.

This slightly reduces the overhead of kernel-mode FPU (since the result
is fewer checks), and it fixes the issue reported at
https://lore.kernel.org/r/20250516112217.GBaCcf6Yoc6LkIIryP@fat_crate.local/
where irq_fpu_usable() incorrectly returned false during CPU
initialization, causing a crash in the SHA-256 library code.

Eric Biggers (3):
  x86/fpu: Add fpu_save_state() for __save_processor_state()
  x86/pm: Use fpu_save_state() in __save_processor_state()
  x86/fpu: Don't support kernel-mode FPU when irqs_disabled()

 arch/x86/include/asm/fpu/api.h |  1 +
 arch/x86/kernel/fpu/core.c     | 92 ++++++++++++++++++++--------------
 arch/x86/power/cpu.c           | 18 +++----
 3 files changed, 62 insertions(+), 49 deletions(-)


base-commit: 8566fc3b96539e3235909d6bdda198e1282beaed
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ