linux_dsm_epyc7002/arch
Arvind Sankar b17a45b6e5 x86/boot/64: Explicitly map boot_params and command line
Commits

  ca0e22d4f0 ("x86/boot/compressed/64: Always switch to own page table")
  8570978ea0 ("x86/boot/compressed/64: Don't pre-map memory in KASLR code")

set up a new page table in the decompressor stub, but without explicit
mappings for boot_params and the kernel command line, relying on the #PF
handler instead.

This is fragile, as boot_params and the command line mappings are
required for the main kernel. If EARLY_PRINTK and RANDOMIZE_BASE are
disabled, a QEMU/OVMF boot never accesses the command line in the
decompressor stub, and so it never gets mapped. The main kernel accesses
it from the identity mapping if AMD_MEM_ENCRYPT is enabled, and will
crash.

Fix this by adding back the explicit mapping of boot_params and the
command line.

Note: the changes also removed the explicit mapping of the main kernel,
with the result that .bss and .brk may not be in the identity mapping,
but those don't get accessed by the main kernel before it switches to
its own page tables.

 [ bp: Pass boot_params with a MOV %rsp... instead of PUSH/POP. Use
   block formatting for the comment. ]

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
Link: https://lkml.kernel.org/r/20201016200404.1615994-1-nivedita@alum.mit.edu
2020-10-19 19:39:50 +02:00
..
alpha Merge branch 'work.csum_and_copy' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:24:13 -07:00
arc This tree prepares to unify the kretprobe trampoline handler and make 2020-10-12 14:21:15 -07:00
arm Merge branch 'akpm' (patches from Andrew) 2020-10-14 09:57:24 -07:00
arm64 Merge branch 'akpm' (patches from Andrew) 2020-10-14 09:57:24 -07:00
c6x arch, drivers: replace for_each_membock() with for_each_mem_range() 2020-10-13 18:38:35 -07:00
csky seccomp updates for v5.10-rc1 2020-10-13 16:33:43 -07:00
h8300 h8300, nds32, openrisc: simplify detection of memory extents 2020-10-13 18:38:35 -07:00
hexagon Merge branch 'work.csum_and_copy' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:24:13 -07:00
ia64 Merge branch 'work.csum_and_copy' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:24:13 -07:00
m68k Merge branch 'work.csum_and_copy' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:24:13 -07:00
microblaze Merge branch 'akpm' (patches from Andrew) 2020-10-14 09:57:24 -07:00
mips Merge branch 'akpm' (patches from Andrew) 2020-10-14 09:57:24 -07:00
nds32 h8300, nds32, openrisc: simplify detection of memory extents 2020-10-13 18:38:35 -07:00
nios2 Merge branch 'work.csum_and_copy' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:24:13 -07:00
openrisc arch, drivers: replace for_each_membock() with for_each_mem_range() 2020-10-13 18:38:35 -07:00
parisc seccomp updates for v5.10-rc1 2020-10-13 16:33:43 -07:00
powerpc Merge branch 'akpm' (patches from Andrew) 2020-10-14 09:57:24 -07:00
riscv Merge branch 'akpm' (patches from Andrew) 2020-10-14 09:57:24 -07:00
s390 Merge branch 'akpm' (patches from Andrew) 2020-10-14 09:57:24 -07:00
sh Merge branch 'akpm' (patches from Andrew) 2020-10-14 09:57:24 -07:00
sparc Merge branch 'akpm' (patches from Andrew) 2020-10-14 09:57:24 -07:00
um seccomp updates for v5.10-rc1 2020-10-13 16:33:43 -07:00
x86 x86/boot/64: Explicitly map boot_params and command line 2020-10-19 19:39:50 +02:00
xtensa Merge branch 'akpm' (patches from Andrew) 2020-10-14 09:57:24 -07:00
.gitignore
Kconfig seccomp updates for v5.10-rc1 2020-10-13 16:33:43 -07:00