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>] [day] [month] [year] [list]
Message-Id: <20240325224140.1911036-1-linux@roeck-us.net>
Date: Mon, 25 Mar 2024 15:41:40 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Dinh Nguyen <dinguyen@...nel.org>
Cc: linux-kernel@...r.kernel.org,
	Guenter Roeck <linux@...ck-us.net>
Subject: [PATCH] nios2: Call handle_mm_fault() with interrupts enabled

The following log message is reported at each boot if
CONFIG_DEBUG_ATOMIC_SLEEP is enabled.

BUG: sleeping function called from invalid context at mm/rmap.c:194
in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 23, name: modprobe
preempt_count: 0, expected: 0
CPU: 0 PID: 23 Comm: modprobe Not tainted 6.9.0-rc1-00033-g5afc2860dc51 #1

Fix by enabling local interrupts while calling handle_mm_fault().

Note: I don't really know what I am doing here.

Signed-off-by: Guenter Roeck <linux@...ck-us.net>
---
I don't really know what I am doing here, so this is just a wild shot.
It _does_ fix the backtrace, and I have not seen any problems, but that is
just with basic qemu testing.

 arch/nios2/mm/fault.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/nios2/mm/fault.c b/arch/nios2/mm/fault.c
index e3fa9c15181d..b468d5ca78a1 100644
--- a/arch/nios2/mm/fault.c
+++ b/arch/nios2/mm/fault.c
@@ -121,7 +121,9 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long cause,
 	 * make sure we exit gracefully rather than endlessly redo
 	 * the fault.
 	 */
+	local_irq_enable();
 	fault = handle_mm_fault(vma, address, flags, regs);
+	local_irq_disable();
 
 	if (fault_signal_pending(fault, regs)) {
 		if (!user_mode(regs))
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ