linux-stable/arch/x86
Vincent Whitchurch 668ca34a42 um: Fix out-of-bounds read in LDT setup
commit 2a4a62a14b upstream.

syscall_stub_data() expects the data_count parameter to be the number of
longs, not bytes.

 ==================================================================
 BUG: KASAN: stack-out-of-bounds in syscall_stub_data+0x70/0xe0
 Read of size 128 at addr 000000006411f6f0 by task swapper/1

 CPU: 0 PID: 1 Comm: swapper Not tainted 5.18.0+ #18
 Call Trace:
  show_stack.cold+0x166/0x2a7
  __dump_stack+0x3a/0x43
  dump_stack_lvl+0x1f/0x27
  print_report.cold+0xdb/0xf81
  kasan_report+0x119/0x1f0
  kasan_check_range+0x3a3/0x440
  memcpy+0x52/0x140
  syscall_stub_data+0x70/0xe0
  write_ldt_entry+0xac/0x190
  init_new_ldt+0x515/0x960
  init_new_context+0x2c4/0x4d0
  mm_init.constprop.0+0x5ed/0x760
  mm_alloc+0x118/0x170
  0x60033f48
  do_one_initcall+0x1d7/0x860
  0x60003e7b
  kernel_init+0x6e/0x3d4
  new_thread_handler+0x1e7/0x2c0

 The buggy address belongs to stack of task swapper/1
  and is located at offset 64 in frame:
  init_new_ldt+0x0/0x960

 This frame has 2 objects:
  [32, 40) 'addr'
  [64, 80) 'desc'
 ==================================================================

Fixes: 858259cf7d ("uml: maintain own LDT entries")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-14 16:52:35 +02:00
..
boot x86/boot/compressed: Disable relocation relaxation 2021-01-30 13:27:16 +01:00
configs x86/defconfig: Enable CONFIG_USB_XHCI_HCD=y 2020-09-23 08:46:16 +02:00
crypto
entry x86/entry/64: Add instruction suffix 2021-01-09 13:35:48 +01:00
events perf/x86/intel/pt: Fix address filter config for 32-bit kernel 2022-04-20 09:06:32 +02:00
ia32
include x86/pm: Fix false positive kmemleak report in msr_build_context() 2022-06-14 16:52:31 +02:00
kernel x86/mm: Cleanup the control_va_addr_alignment() __setup handler 2022-06-14 16:52:32 +02:00
kvm kvm: x86/cpuid: Only provide CPUID leaf 0xA if host has architectural PMU 2022-05-12 12:14:58 +02:00
lguest
lib x86/delay: Fix the wrong asm constraint in delay_loop() 2022-06-14 16:52:31 +02:00
math-emu x86: math-emu: Fix up 'cmp' insn for clang ias 2020-07-31 16:44:04 +02:00
mm gup: document and work around "COW can break either way" issue 2022-01-27 08:47:42 +01:00
net bpf, x86: Validate computation of branch displacements for x86-64 2021-04-10 13:04:45 +02:00
oprofile
pci x86/PCI: Mark Intel C620 MROMs as having non-compliant BARs 2020-06-20 10:24:08 +02:00
platform efi/x86: Map the entire EFI vendor string before copying it 2020-02-28 15:42:19 +01:00
power x86/cpu: Load microcode during restore_processor_state() 2022-05-12 12:14:56 +02:00
purgatory
ras
realmode
tools x86/tools: Fix objdump version check again 2021-08-26 08:37:23 -04:00
um um: Fix out-of-bounds read in LDT setup 2022-06-14 16:52:35 +02:00
video
xen xen/x86: fix PV trap handling on secondary processors 2021-10-06 10:23:38 +02:00
.gitignore
Kbuild
Kconfig x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support 2022-03-11 10:03:30 +01:00
Kconfig.cpu
Kconfig.debug x86, perf: Fix the dependency of the x86 insn decoder selftest 2020-01-29 10:24:31 +01:00
Makefile x86/build: Fix compiler support check for CONFIG_RETPOLINE 2022-03-11 10:03:32 +01:00
Makefile.um
Makefile_32.cpu