]> www.infradead.org Git - users/jedix/linux-maple.git/commit
exit: Detect and fix irq disabled state in oops
authorNicholas Piggin <npiggin@gmail.com>
Fri, 20 Jan 2023 01:18:20 +0000 (11:18 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:45 +0000 (09:33 +0100)
commit711bd1b553299272679822a677a25e22f4ba6647
treeb1b3c7aa3dddd247f492871c4671dd36dc8b1f29
parent982f8ef8ec7e9a4cdb110d020c6be12ae9a6fbce
exit: Detect and fix irq disabled state in oops

[ Upstream commit 001c28e57187570e4b5aa4492c7a957fb6d65d7b ]

If a task oopses with irqs disabled, this can cause various cascading
problems in the oops path such as sleep-from-invalid warnings, and
potentially worse.

Since commit 0258b5fd7c712 ("coredump: Limit coredumps to a single
thread group"), the unconditional irq enable in coredump_task_exit()
will "fix" the irq state to be enabled early in do_exit(), so currently
this may not be triggerable, but that is coincidental and fragile.

Detect and fix the irqs_disabled() condition in the oops path before
calling do_exit(), similarly to the way in_atomic() is handled.

Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Link: https://lore.kernel.org/lkml/20221004094401.708299-1-npiggin@gmail.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/exit.c