kernel_samsung_a53x/arch
Masahiro Yamada 009969cd50 ARM: 9324/1: fix get_user() broken with veneer
commit 24d3ba0a7b44c1617c27f5045eecc4f34752ab03 upstream.

The 32-bit ARM kernel stops working if the kernel grows to the point
where veneers for __get_user_* are created.

AAPCS32 [1] states, "Register r12 (IP) may be used by a linker as a
scratch register between a routine and any subroutine it calls. It
can also be used within a routine to hold intermediate values between
subroutine calls."

However, bl instructions buried within the inline asm are unpredictable
for compilers; hence, "ip" must be added to the clobber list.

This becomes critical when veneers for __get_user_* are created because
veneers use the ip register since commit 02e541db0540 ("ARM: 8323/1:
force linker to use PIC veneers").

[1]: https://github.com/ARM-software/abi-aa/blob/2023Q1/aapcs32/aapcs32.rst

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Cc: John Stultz <jstultz@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 14:19:50 +01:00
..
alpha Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-11-19 11:32:36 +01:00
arm ARM: 9324/1: fix get_user() broken with veneer 2024-11-19 14:19:50 +01:00
arm64 syscalls: fix compat_sys_io_pgetevents_time64 usage 2024-11-19 14:19:34 +01:00
c6x Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
csky csky, hexagon: fix broken sys_sync_file_range 2024-11-19 14:19:34 +01:00
h8300 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-11-19 14:19:34 +01:00
ia64 efi: ia64: move IA64-only declarations to new asm/efi.h header 2024-11-19 14:19:45 +01:00
m68k m68k: mac: Fix reboot hang on Mac IIci 2024-11-19 12:26:56 +01:00
microblaze microblaze: Remove early printk call from cpuinfo-static.c 2024-11-19 12:27:04 +01:00
mips mips: fix compat_sys_lseek syscall 2024-11-19 14:19:48 +01:00
nds32 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nios2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
openrisc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
parisc parisc: use correct compat recv/recvfrom syscalls 2024-11-19 14:19:32 +01:00
powerpc powerpc/eeh: avoid possible crash when edev->pdev changes 2024-11-19 14:19:50 +01:00
riscv riscv: Disable STACKPROTECTOR_PER_TASK if GCC_PLUGIN_RANDSTRUCT is enabled 2024-11-19 11:32:40 +01:00
s390 s390: Mark psw in __load_psw_mask() as __unitialized 2024-11-19 14:19:44 +01:00
sh Revert "sh: Handle calling csum_partial with misaligned data" 2024-11-19 12:26:56 +01:00
sparc syscalls: fix compat_sys_io_pgetevents_time64 usage 2024-11-19 14:19:34 +01:00
um um: Fix the -Wmissing-prototypes warning for __switch_mm 2024-11-19 12:27:06 +01:00
x86 x86/retpoline: Move a NOENDBR annotation to the SRSO dummy return thunk 2024-11-19 14:19:45 +01:00
xtensa Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-11-19 11:32:38 +01:00