linux-stable/arch
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
..
alpha scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
arc ARC: elf: use right ELF_ARCH 2020-07-16 08:17:27 +02:00
arm ARM: dts: socfpga: Align L2 cache-controller nodename with dtschema 2020-07-22 09:32:06 +02:00
arm64 arm64: Use test_tsk_thread_flag() for checking TIF_SINGLESTEP 2020-07-29 10:16:54 +02:00
c6x
h8300
hexagon hexagon: define ioremap_uc 2020-05-10 10:30:11 +02:00
ia64 scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
m68k scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
microblaze microblaze: Prevent the overflow of the start 2020-02-24 08:34:53 +01:00
mips MIPS: Fix build for LTS kernel caused by backporting lpj adjustment 2020-07-22 09:32:11 +02:00
nds32 nds32: Fix the items of hwcap_str ordering issue. 2019-12-13 08:51:35 +01:00
nios2 nios2: ksyms: Add missing symbol exports 2020-01-27 14:50:30 +01:00
openrisc openrisc: Fix issue with argument clobbering for clone/fork 2020-06-25 15:33:01 +02:00
parisc parisc: Add atomic64_set_release() define to avoid CPU soft lockups 2020-07-29 10:16:58 +02:00
powerpc powerpc/book3s64/pkeys: Fix pkey_access_permitted() for execute disable pkey 2020-07-22 09:32:11 +02:00
riscv RISC-V: Upgrade smp_mb__after_spinlock() to iorw,iorw 2020-07-29 10:16:54 +02:00
s390 s390/mm: fix huge pte soft dirty copying 2020-07-16 08:17:28 +02:00
sh scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
sparc scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
um um: ubd: Prevent buffer overrun on command completion 2020-04-23 10:30:19 +02:00
unicore32
x86 x86, vmlinux.lds: Page-align end of ..page_aligned sections 2020-07-29 10:16:58 +02:00
xtensa xtensa: update *pos in cpuinfo_op.next 2020-07-29 10:16:45 +02:00
.gitignore
Kconfig