In the Linux kernel, the following vulnerability has been resolved:
arm64: efi: Make efirtlock a raw_spinlock
Running a rt-kernel base on 6.2.0-rc3-rt1 on an Ampere Altra outputs the following: BUG: sleeping function called from invalid context at kernel/locking/spinlockrt.c:46 inatomic(): 1, irqsdisabled(): 0, nonblock: 0, pid: 9, name: kworker/u320:0 preemptcount: 2, expected: 0 RCU nest depth: 0, expected: 0 3 locks held by kworker/u320:0/9: #0: ffff3fff8c27d128 ((wqcompletion)efirtswq){+.+.}-{0:0}, at: processonework (./include/linux/atomic/atomic-long.h:41) #1: ffff80000861bdd0 ((workcompletion)(&efirtswork.work)){+.+.}-{0:0}, at: processonework (./include/linux/atomic/atomic-long.h:41) #2: ffffdf7e1ed3e460 (efirtlock){+.+.}-{3:3}, at: eficallrts (drivers/firmware/efi/runtime-wrappers.c:101) Preemption disabled at: efivirtmapload (./arch/arm64/include/asm/mmucontext.h:248) CPU: 0 PID: 9 Comm: kworker/u320:0 Tainted: G W 6.2.0-rc3-rt1 Hardware name: WIWYNN Mt.Jade Server System B81.03001.0005/Mt.Jade Motherboard, BIOS 1.08.20220218 (SCP: 1.08.20220218) 2022/02/18 Workqueue: efirtswq eficallrts Call trace: dumpbacktrace (arch/arm64/kernel/stacktrace.c:158) showstack (arch/arm64/kernel/stacktrace.c:165) dumpstacklvl (lib/dumpstack.c:107 (discriminator 4)) dumpstack (lib/dumpstack.c:114) _mightresched (kernel/sched/core.c:10134) rtspinlock (kernel/locking/rtmutex.c:1769 (discriminator 4)) eficall_rts (drivers/firmware/efi/runtime-wrappers.c:101) [...]
This seems to come from commit ff7a167961d1 ("arm64: efi: Execute runtime services from a dedicated stack") which adds a spinlock. This spinlock is taken through: eficallrts() -eficallvirt() -eficallvirtpointer() -archeficallvirt_setup()
Make 'efirtlock' a raw_spinlock to avoid being preempted.
[ardb: The EFI runtime services are called with a different set of translation tables, and are permitted to use the SIMD registers. The context switch code preserves/restores neither, and so EFI calls must be made with preemption disabled, rather than only disabling migration.]