linux-stable/arch
Kees Cook 567cfc59e4 x86/uaccess: Fix missed zeroing of ia32 u64 get_user() range checking
[ Upstream commit 8c860ed825 ]

When reworking the range checking for get_user(), the get_user_8() case
on 32-bit wasn't zeroing the high register. (The jump to bad_get_user_8
was accidentally dropped.) Restore the correct error handling
destination (and rename the jump to using the expected ".L" prefix).

While here, switch to using a named argument ("size") for the call
template ("%c4" to "%c[size]") as already used in the other call
templates in this file.

Found after moving the usercopy selftests to KUnit:

      # usercopy_test_invalid: EXPECTATION FAILED at
      lib/usercopy_kunit.c:278
      Expected val_u64 == 0, but
          val_u64 == -60129542144 (0xfffffff200000000)

Closes: https://lore.kernel.org/all/CABVgOSn=tb=Lj9SxHuT4_9MTjjKVxsq-ikdXC4kGHO4CfKVmGQ@mail.gmail.com
Fixes: b19b74bc99 ("x86/mm: Rework address range check in get_user() and put_user()")
Reported-by: David Gow <davidgow@google.com>
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Tested-by: David Gow <davidgow@google.com>
Link: https://lore.kernel.org/all/20240610210213.work.143-kees%40kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-21 14:38:34 +02:00
..
alpha
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:32:33 +02:00
arm ARM: dts: samsung: exynos4412-origen: fix keypad no-autorepeat 2024-06-16 13:47:45 +02:00
arm64 KVM: arm64: AArch32: Fix spurious trapping of conditional instructions 2024-06-16 13:47:38 +02:00
csky work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:24:47 +01:00
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-04-03 15:28:55 +02:00
ia64
loongarch LoongArch: Override higher address bits in JUMP_VIRT_ADDR 2024-06-16 13:47:39 +02:00
m68k m68k: mac: Fix reboot hang on Mac IIci 2024-06-12 11:11:51 +02:00
microblaze microblaze: Remove early printk call from cpuinfo-static.c 2024-06-12 11:12:23 +02:00
mips MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 12:02:15 +02:00
nios2
openrisc openrisc: traps: Don't send signals to kernel mode threads 2024-06-12 11:11:42 +02:00
parisc parisc: Define sigset_t in parisc uapi header 2024-06-16 13:47:45 +02:00
powerpc powerpc/uaccess: Fix build errors seen with GCC 13/14 2024-06-21 14:38:26 +02:00
riscv RISC-V: KVM: Fix incorrect reg_subtype labels in kvm_riscv_vcpu_set_reg_isa_ext function 2024-06-21 14:38:14 +02:00
s390 s390/cpacf: Make use of invalid opcode produce a link error 2024-06-16 13:47:46 +02:00
sh Revert "sh: Handle calling csum_partial with misaligned data" 2024-06-12 11:11:48 +02:00
sparc sparc: move struct termio to asm/termios.h 2024-06-16 13:47:44 +02:00
um um: Fix the declaration of kasan_map_memory 2024-06-12 11:12:42 +02:00
x86 x86/uaccess: Fix missed zeroing of ia32 u64 get_user() range checking 2024-06-21 14:38:34 +02:00
xtensa xtensa: fix MAKE_PC_FROM_RA second argument 2024-05-17 12:02:32 +02:00
.gitignore
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:32:44 +02:00