android_kernel_motorola_sm6375/arch/x86
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Richard Palethorpe 3cdbfac106 x86/entry/ia32: Ensure s32 is sign extended to s64
commit 56062d60f117dccfb5281869e0ab61e090baf864 upstream.

Presently ia32 registers stored in ptregs are unconditionally cast to
unsigned int by the ia32 stub. They are then cast to long when passed to
__se_sys*, but will not be sign extended.

This takes the sign of the syscall argument into account in the ia32
stub. It still casts to unsigned int to avoid implementation specific
behavior. However then casts to int or unsigned int as necessary. So that
the following cast to long sign extends the value.

This fixes the io_pgetevents02 LTP test when compiled with -m32. Presently
the systemcall io_pgetevents_time64() unexpectedly accepts -1 for the
maximum number of events.

It doesn't appear other systemcalls with signed arguments are effected
because they all have compat variants defined and wired up.

Fixes: ebeb8c82ff ("syscalls/x86: Use 'struct pt_regs' based syscall calling for IA32_EMULATION and x32")
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240110130122.3836513-1-nik.borisov@suse.com
Link: https://lore.kernel.org/ltp/20210921130127.24131-1-rpalethorpe@suse.com/
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 08:24:53 +01:00
..
boot x86/decompressor: Don't rely on upper 32 bits of GPRs being preserved 2023-09-23 10:59:41 +02:00
configs
crypto crypto: x86/ghash - fix unaligned access in ghash_setkey() 2023-03-11 16:43:38 +01:00
entry x86/asm: Make more symbols local 2023-09-23 10:59:40 +02:00
events perf/x86/amd: fix potential integer overflow on shift of a int 2023-02-06 07:52:47 +01:00
hyperv
ia32
include x86/entry/ia32: Ensure s32 is sign extended to s64 2024-02-23 08:24:53 +01:00
kernel x86/CPU/AMD: Fix disabling XSAVES on AMD family 0x17 due to erratum 2024-02-23 08:24:50 +01:00
kvm KVM: x86: Ignore MSR_AMD64_TW_CFG access 2023-11-28 16:50:18 +00:00
lib x86/lib: Fix overflow when counting digits 2024-01-25 14:34:21 -08:00
math-emu
mm x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size 2023-11-28 16:50:13 +00:00
net
oprofile
pci x86/PCI: Add quirk for AMD XHCI controller that loses MSI-X state in D3hot 2023-04-20 12:07:32 +02:00
platform
power
purgatory x86/purgatory: remove PGO flags 2023-06-28 10:18:35 +02:00
ras
realmode x86/asm: Make more symbols local 2023-09-23 10:59:40 +02:00
tools
um x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list 2023-03-11 16:44:10 +01:00
video
xen x86/xen: Fix secondary processors' FPU initialization 2023-08-08 19:56:35 +02:00
.gitignore
Kbuild
Kconfig x86/speculation: Add Kconfig option for GDS 2023-08-08 19:56:35 +02:00
Kconfig.cpu
Kconfig.debug
Makefile
Makefile.um
Makefile_32.cpu