]> git.baikalelectronics.ru Git - kernel.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)
commit481e9180893f522ded9ffa6992cbaf4d7650c04e
treeb1b3c7aa3dddd247f492871c4671dd36dc8b1f29
parent25494687a5c3554df6bd9cc4bcfdc5aa0682af15
exit: Detect and fix irq disabled state in oops

[ Upstream commit d89b5c6e97ea230480a09e8bc1be0a769f401ed8 ]

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 55bff12cd2439 ("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