original_kernel/arch/x86/lib
Kees Cook 8c860ed825 x86/uaccess: Fix missed zeroing of ia32 u64 get_user() range checking
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
2024-06-11 16:08:43 -07:00
..
.gitignore
Makefile
atomic64_32.c
atomic64_386_32.S
atomic64_cx8_32.S
cache-smp.c
checksum_32.S
clear_page_64.S
cmdline.c
cmpxchg8b_emu.S
cmpxchg16b_emu.S
copy_mc.c
copy_mc_64.S
copy_page_64.S
copy_user_64.S
copy_user_uncached_64.S
cpu.c
csum-copy_64.S
csum-partial_64.c
csum-wrappers_64.c
delay.c
error-inject.c
getuser.S x86/uaccess: Fix missed zeroing of ia32 u64 get_user() range checking 2024-06-11 16:08:43 -07:00
hweight.S
inat.c
insn-eval.c
insn.c x86/insn: Add support for APX EVEX to the instruction decoder logic 2024-05-02 13:13:45 +02:00
iomem.c
kaslr.c
memcpy_32.c
memcpy_64.S
memmove_32.S
memmove_64.S
memset_64.S
misc.c
msr-reg-export.c
msr-reg.S
msr-smp.c
msr.c
pc-conf-reg.c
putuser.S
retpoline.S
string_32.c
strstr_32.c
usercopy.c
usercopy_32.c
usercopy_64.c
x86-opcode-map.txt x86/insn: Add support for APX EVEX instructions to the opcode map 2024-05-02 13:13:46 +02:00