linux-stable/arch/x86
Joerg Roedel 159bcd5488 x86, vmlinux.lds: Page-align end of ..page_aligned sections
commit de2b41be8f upstream.

On x86-32 the idt_table with 256 entries needs only 2048 bytes. It is
page-aligned, but the end of the .bss..page_aligned section is not
guaranteed to be page-aligned.

As a result, objects from other .bss sections may end up on the same 4k
page as the idt_table, and will accidentially get mapped read-only during
boot, causing unexpected page-faults when the kernel writes to them.

This could be worked around by making the objects in the page aligned
sections page sized, but that's wrong.

Explicit sections which store only page aligned objects have an implicit
guarantee that the object is alone in the page in which it is placed. That
works for all objects except the last one. That's inconsistent.

Enforcing page sized objects for these sections would wreckage memory
sanitizers, because the object becomes artificially larger than it should
be and out of bound access becomes legit.

Align the end of the .bss..page_aligned and .data..page_aligned section on
page-size so all objects places in these sections are guaranteed to have
their own page.

[ tglx: Amended changelog ]

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20200721093448.10417-1-joro@8bytes.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-29 10:16:58 +02:00
..
boot x86/boot/compressed: Relax sed symbol type regex for LLVM ld.lld 2020-06-25 15:33:07 +02:00
configs scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
crypto crypto: x86/crct10dif-pcl - fix use via crypto_shash_digest() 2019-05-22 07:37:37 +02:00
entry x86/unwind/orc: Fix premature unwind stoppage due to IRET frames 2020-05-14 07:57:23 +02:00
events perf/amd/uncore: Replace manual sampling check with CAP_NO_INTERRUPT flag 2020-03-20 11:55:50 +01:00
hyperv x86/Hyper-V: Report crash data in die() when panic_on_oops is set 2020-04-23 10:30:17 +02:00
ia32 x86/ia32: Fix ia32_restore_sigcontext() AC leak 2019-05-31 06:46:27 -07:00
include x86/entry: Increase entry_stack size to a full page 2020-07-16 08:17:23 +02:00
kernel x86, vmlinux.lds: Page-align end of ..page_aligned sections 2020-07-29 10:16:58 +02:00
kvm KVM: x86: Mark CR4.TSD as being possibly owned by the guest 2020-07-16 08:17:26 +02:00
lib x86/asm/64: Align start of __clear_user() loop to 16-bytes 2020-06-30 23:17:16 -04:00
math-emu x86: math-emu: Fix up 'cmp' insn for clang ias 2020-07-29 10:16:54 +02:00
mm x86/mm: Stop printing BRK addresses 2020-06-22 09:05:18 +02:00
net bpf, x86_32: Fix clobbering of dst for BPF_JSET 2020-05-02 17:26:00 +02:00
oprofile
pci x86/PCI: Mark Intel C620 MROMs as having non-compliant BARs 2020-06-22 09:05:01 +02:00
platform irqdomain/treewide: Keep firmware node unconditionally allocated 2020-07-29 10:16:46 +02:00
power PM / hibernate: Check the success of generating md5 digest before hibernation 2019-11-24 08:19:56 +01:00
purgatory x86/purgatory: Disable various profiling and sanitizing options 2020-06-25 15:32:52 +02:00
ras
realmode x86/realmode: Don't leak the trampoline kernel address 2019-05-04 09:20:21 +02:00
tools x86/insn: Fix awk regexp warnings 2019-12-01 09:17:37 +01:00
um um: Drop own definition of PTRACE_SYSEMU/_SINGLESTEP 2018-11-21 09:19:16 +01:00
video
xen x86: Fix early boot crash on gcc-10, third try 2020-05-20 08:18:49 +02:00
.gitignore
Kbuild
Kconfig x86/olpc: Fix build error with CONFIG_MFD_CS5535=m 2019-11-24 08:20:30 +01:00
Kconfig.cpu
Kconfig.debug x86, perf: Fix the dependency of the x86 insn decoder selftest 2020-01-27 14:51:08 +01:00
Makefile x86/build: Add -Wnoaddress-of-packed-member to REALMODE_CFLAGS, to silence GCC9 build warning 2019-09-19 09:09:41 +02:00
Makefile.um kbuild: rename LDFLAGS to KBUILD_LDFLAGS 2018-08-24 08:22:08 +09:00
Makefile_32.cpu