linux/arch/arm/vfp
Ard Biesheuvel 2b951b0efb ARM: 9297/1: vfp: avoid unbalanced stack on 'success' return path
Commit c76c6c4ecb ("ARM: 9294/2: vfp: Fix broken softirq handling
with instrumentation enabled") updated the VFP exception entry logic to
go via a C function, so that we get the compiler's version of
local_bh_disable(), which may be instrumented, and isn't generally
callable from assembler.

However, this assumes that passing an alternative 'success' return
address works in C as it does in asm, and this is only the case if the C
calls in question are tail calls, as otherwise, the stack will need some
unwinding as well.

I have already sent patches to the list that replace most of the asm
logic with C code, and so it is preferable to have a minimal fix that
addresses the issue and can be backported along with the commit that it

fixes to v6.3 from v6.4. Hopefully, we can land the C conversion for v6.5.

So instead of passing the 'success' return address as a function
argument, pass the stack address from where to pop it so that both LR
and SP have the expected value.

Fixes: c76c6c4ecb ("ARM: 9294/2: vfp: Fix broken softirq handling with ...")
Reported-by: syzbot+d4b00edc2d0c910d4bf4@syzkaller.appspotmail.com
Tested-by: syzbot+d4b00edc2d0c910d4bf4@syzkaller.appspotmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2023-05-10 10:50:25 +01:00
..
entry.S ARM: 9297/1: vfp: avoid unbalanced stack on 'success' return path 2023-05-10 10:50:25 +01:00
Makefile ARM: 8989/1: use .fpu assembler directives instead of assembler arguments 2020-07-21 16:33:37 +01:00
vfp.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vfpdouble.c ARM: 8026/1: Fix emulation of multiply accumulate instructions 2014-04-14 23:28:24 +01:00
vfphw.S ARM: 9297/1: vfp: avoid unbalanced stack on 'success' return path 2023-05-10 10:50:25 +01:00
vfpinstr.h ARM: 8991/1: use VFP assembler mnemonics if available 2020-07-21 16:33:39 +01:00
vfpmodule.c ARM: 9294/2: vfp: Fix broken softirq handling with instrumentation enabled 2023-04-12 10:04:56 +01:00
vfpsingle.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00