]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Trap WFI executed in userspace
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 1 Oct 2018 11:19:43 +0000 (12:19 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 1 Oct 2018 15:52:24 +0000 (16:52 +0100)
commit7a8458bc33f3649222ce94c72b8e5631a1082b23
treebf2043211dbd9423e10005d6872d348065fb40cb
parent334cf7410a4babb0e509d26e15acdf0c7b78a501
arm64: Trap WFI executed in userspace

It recently came to light that userspace can execute WFI, and that
the arm64 kernel doesn't trap this event. This sounds rather benign,
but the kernel should decide when it wants to wait for an interrupt,
and not userspace.

Let's trap WFI and immediately return after having skipped the
instruction. This effectively makes WFI a rather expensive NOP.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/esr.h
arch/arm64/include/asm/sysreg.h
arch/arm64/kernel/entry.S
arch/arm64/kernel/traps.c