]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/irq: Make run_on_irqstack_cond() typesafe
authorThomas Gleixner <tglx@linutronix.de>
Tue, 22 Sep 2020 07:58:52 +0000 (09:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 15:36:32 +0000 (17:36 +0200)
commite45e8ddf3cfcc7eb756caa35d81c731282b5d0d1
tree7a23b1480a012b7a24e150f00d102737abfeb9d2
parentba1c6085305773ec26f24cdd5e6c3723f27c71c0
x86/irq: Make run_on_irqstack_cond() typesafe

commit a7b3474cbb2864d5500d5e4f48dd57c903975cab upstream.

Sami reported that run_on_irqstack_cond() requires the caller to cast
functions to mismatching types, which trips indirect call Control-Flow
Integrity (CFI) in Clang.

Instead of disabling CFI on that function, provide proper helpers for
the three call variants. The actual ASM code stays the same as that is
out of reach.

 [ bp: Fix __run_on_irqstack() prototype to match. ]

Fixes: 931b94145981 ("x86/entry: Provide helpers for executing on the irqstack")
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Reported-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Sami Tolvanen <samitolvanen@google.com>
Cc: <stable@vger.kernel.org>
Link: https://github.com/ClangBuiltLinux/linux/issues/1052
Link: https://lkml.kernel.org/r/87pn6eb5tv.fsf@nanos.tec.linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/entry/common.c
arch/x86/entry/entry_64.S
arch/x86/include/asm/idtentry.h
arch/x86/include/asm/irq_stack.h
arch/x86/kernel/irq.c
arch/x86/kernel/irq_64.c