exynos-linux-stable/arch/x86/kernel
Joerg Roedel d04fa6e9bd
x86, vmlinux.lds: Page-align end of ..page_aligned sections
[ Upstream commit de2b41be8fcccb2f5b6c480d35df590476344201 ]

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: Sasha Levin <sashal@kernel.org>
2023-04-30 22:09:55 +03:00
..
acpi x86/suspend: fix false positive KASAN warning on suspend/resume 2019-05-08 07:19:06 +02:00
apic x86/ioapic: Prevent inconsistent state when moving an interrupt 2020-01-04 13:39:29 +01:00
cpu x86/pkeys: Manually set X86_FEATURE_OSPKE to preserve existing changes 2020-03-11 07:53:12 +01:00
fpu x86/fpu: Disable bottom halves while loading FPU registers 2018-12-29 13:40:15 +01:00
kprobes kprobes/x86: Prohibit probing on exception masking instructions 2019-11-25 09:53:12 +01:00
.gitignore
alternative.c UPSTREAM: x86/alternative: Print unadorned pointers 2019-03-28 21:13:06 -07:00
amd_gart_64.c dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
amd_nb.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:43:55 +01:00
apb_timer.c x86/apb_timer: Convert to hotplug state machine 2016-07-15 10:40:22 +02:00
aperture_64.c
apm_32.c x86/apm: Don't access __preempt_count with zeroed fs 2018-07-25 11:23:58 +02:00
asm-offsets.c x86: Move thread_info into task_struct 2016-09-15 08:25:13 +02:00
asm-offsets_32.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:43:55 +01:00
asm-offsets_64.c sched/x86: Rewrite the switch_to() code 2016-08-24 12:31:41 +02:00
audit_64.c
bootflag.c
check.c x86/corruption-check: Fix panic in memory_corruption_check() when boot option without value is provided 2018-11-13 11:16:47 -08:00
cpuid.c
crash.c x86/panic: replace smp_send_stop() with kdump friendly version in panic path 2016-10-11 15:06:32 -07:00
crash_dump_32.c
crash_dump_64.c
devicetree.c x86/devicetree: Fix device IRQ settings in DT 2018-05-30 07:50:48 +02:00
doublefault.c
dumpstack.c x86/entry/64: Wipe KASAN stack shadow before rewind_stack_do_exit() 2018-09-05 09:20:10 +02:00
dumpstack_32.c x86/dumpstack: Remove dump_trace() and related callbacks 2016-09-20 08:29:34 +02:00
dumpstack_64.c x86/dumpstack: Remove dump_trace() and related callbacks 2016-09-20 08:29:34 +02:00
e820.c x86/e820: Don't merge consecutive E820_PRAM ranges 2016-10-16 11:16:48 +02:00
early-quirks.c Merge tag 'drm-for-v4.9' of git://people.freedesktop.org/~airlied/linux 2016-10-11 18:12:22 -07:00
early_printk.c
ebda.c x86/boot: Simplify EBDA-vs-BIOS reservation logic 2016-07-22 11:46:01 +02:00
espfix_64.c kaiser: add "nokaiser" boot option, using ALTERNATIVE 2018-01-05 15:46:34 +01:00
ftrace.c x86: Don't include linux/irq.h from asm/hardirq.h 2018-08-15 18:14:52 +02:00
head32.c x86/boot: Run reserve_bios_regions() after we initialize the memory map 2016-08-11 11:14:59 +02:00
head64.c x86/kasan: Fix boot with KASAN=y and PROFILE_ANNOTATED_BRANCHES=y 2017-03-22 12:43:40 +01:00
head_32.S x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:43:55 +01:00
head_64.S Revert "x86/mm: Expand static page table for fixmap space" 2018-11-10 07:42:59 -08:00
hpet.c x86/hpet: Prevent potential NULL pointer dereference 2019-04-20 09:07:50 +02:00
hw_breakpoint.c x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error 2019-04-20 09:07:50 +02:00
i8237.c
i8253.c x86/kernel: Audit and remove any unnecessary uses of module.h 2016-07-14 15:06:41 +02:00
i8259.c x86: Don't include linux/irq.h from asm/hardirq.h 2018-08-15 18:14:52 +02:00
io_delay.c x86/kernel: Audit and remove any unnecessary uses of module.h 2016-07-14 15:06:41 +02:00
ioport.c
irq.c x86: Don't include linux/irq.h from asm/hardirq.h 2018-08-15 18:14:52 +02:00
irq_32.c x86: Don't include linux/irq.h from asm/hardirq.h 2018-08-15 18:14:52 +02:00
irq_64.c x86/irq/64: Limit IST stack overflow check to #DB stack 2019-05-31 06:48:22 -07:00
irq_work.c x86/irq, trace: Add __irq_entry annotation to x86's platform IRQ handlers 2017-11-21 09:23:24 +01:00
irqflags.S x86/paravirt: Make native_save_fl() extern inline 2018-07-22 14:27:35 +02:00
irqinit.c x86: Don't include linux/irq.h from asm/hardirq.h 2018-08-15 18:14:52 +02:00
jump_label.c
kdebugfs.c x86/kernel: Audit and remove any unnecessary uses of module.h 2016-07-14 15:06:41 +02:00
kexec-bzimage64.c x86/kexec: Don't setup EFI info if EFI runtime is not enabled 2019-03-13 14:04:57 -07:00
kgdb.c x86/kgbd: Use NMI_VECTOR not APIC_DM_NMI 2020-01-29 10:24:29 +01:00
ksysfs.c x86: Apply more __ro_after_init and const 2016-08-10 14:55:05 +02:00
kvm.c kvm/x86: Handle async PF in RCU read-side critical sections 2017-10-05 09:44:03 +02:00
kvmclock.c Merge branch 'linus' into x86/asm, to pick up recent fixes 2016-09-15 08:24:53 +02:00
ldt.c kaiser: fix unlikely error in alloc_ldt_struct() 2018-01-05 15:46:34 +01:00
livepatch.c ANDROID: kallsyms: increase KSYM_NAME_LEN 2023-02-21 00:16:35 +03:00
machine_kexec_32.c x86/kexec: Avoid double free_page() upon do_kexec_load() failure 2018-05-25 16:12:59 +02:00
machine_kexec_64.c x86/kexec: Avoid double free_page() upon do_kexec_load() failure 2018-05-25 16:12:59 +02:00
Makefile x86/paravirt: Make native_save_fl() extern inline 2018-07-22 14:27:35 +02:00
mcount_64.S x86/retpoline/ftrace: Convert ftrace assembler indirect jumps 2018-01-17 09:38:59 +01:00
mmconf-fam10h_64.c
module.c x86: Treat R_X86_64_PLT32 as R_X86_64_PC32 2018-03-18 11:18:55 +01:00
mpparse.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:43:55 +01:00
msr.c
nmi.c x86/speculation/mds: Clear CPU buffers on exit to user 2019-05-14 19:19:40 +02:00
nmi_selftest.c
paravirt-spinlocks.c x86, locking/spinlocks: Remove ticket (spin)lock implementation 2016-09-30 10:56:00 +02:00
paravirt.c x86/paravirt: Fix some warning messages 2018-11-10 07:42:55 -08:00
paravirt_patch_32.c x86, locking/spinlocks: Remove ticket (spin)lock implementation 2016-09-30 10:56:00 +02:00
paravirt_patch_64.c x86/paravirt: Dont patch flush_tlb_single 2018-01-05 15:46:35 +01:00
pci-calgary_64.c x86/pci-calgary: Fix iommu_free() comparison of unsigned expression >= 0 2017-05-14 14:00:17 +02:00
pci-dma.c dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
pci-iommu_table.c
pci-nommu.c dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
pci-swiotlb.c swiotlb: Convert swiotlb_force from int to enum 2017-01-26 08:24:44 +01:00
pcspeaker.c
perf_regs.c
platform-quirks.c x86/boot: Reorganize and clean up the BIOS area reservation code 2016-07-21 10:11:57 +02:00
pmem.c x86/kernel: Audit and remove any unnecessary uses of module.h 2016-07-14 15:06:41 +02:00
probe_roms.c
process.c This is the 4.9.176 stable release 2019-05-14 21:04:42 +02:00
process.h x86/speculation: Avoid __switch_to_xtra() calls 2019-05-14 19:19:38 +02:00
process_32.c sched/x86: Save [ER]FLAGS on context switch 2019-05-21 18:48:56 +02:00
process_64.c sched/x86: Save [ER]FLAGS on context switch 2019-05-21 18:48:56 +02:00
ptrace.c x86/ptrace: fix up botched merge of spectrev1 fix 2019-09-06 10:19:53 +02:00
pvclock.c KVM: x86: introduce get_kvmclock_ns 2016-09-20 09:26:15 +02:00
quirks.c x86/mce: Check for alternate indication of machine check recovery on Skylake 2018-07-03 11:23:05 +02:00
reboot.c x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T 2019-05-16 19:43:42 +02:00
reboot_fixups_32.c
relocate_kernel_32.S
relocate_kernel_64.S
resource.c x86/e820: Prepare e280 code for switch to dynamic storage 2016-09-21 15:02:12 +02:00
rtc.c char/genrtc: x86: remove remnants of asm/rtc.h 2016-06-04 00:20:07 +02:00
setup.c x86/speculation/l1tf: Make sure the first page is always reserved 2018-08-15 18:14:44 +02:00
setup_percpu.c x86/boot/32: Fix UP boot on Quark and possibly other platforms 2018-03-22 09:17:58 +01:00
signal.c x86/uaccess, signal: Fix AC=1 bloat 2019-05-31 06:48:29 -07:00
signal_compat.c x86/signals: Fix lower/upper bound reporting in compat siginfo 2017-04-21 09:31:20 +02:00
smp.c x86/reboot: Always use NMI fallback when shutdown via reboot vector IPI fails 2019-10-05 12:30:18 +02:00
smpboot.c x86/CPU/AMD: Have smp_num_siblings and cpu_llc_id always be present 2018-08-15 18:14:55 +02:00
stacktrace.c x86/stacktrace: Convert save_stack_trace_*() to use the new unwinder 2016-09-20 08:29:33 +02:00
step.c mm: replace access_process_vm() write parameter with gup_flags 2016-10-19 08:31:25 -07:00
sys_x86_64.c x86/mm: Make mmap(MAP_32BIT) work correctly 2018-03-22 09:17:38 +01:00
sysfb.c
sysfb_efi.c x86/sysfb_efi: Add quirks for some devices with swapped width and height 2019-08-04 09:33:42 +02:00
sysfb_simplefb.c x86/sysfb: Fix check for bad VRAM size 2020-02-28 15:42:21 +01:00
tboot.c x86/pti: Make unpoison of pgd for trusted boot work for real 2018-02-13 12:35:55 +01:00
tce_64.c
test_nx.c
test_rodata.c x86: Don't use module.h just for AUTHOR / LICENSE tags 2016-07-14 13:04:20 +02:00
time.c x86/time: Correct the attribute on jiffies' definition 2018-11-10 07:43:01 -08:00
tls.c x86/tls: Fix possible spectre-v1 in do_get_thread_area() 2019-07-21 09:05:58 +02:00
tls.h
topology.c
trace_clock.c
tracepoint.c kaiser: merged update 2018-01-05 15:46:32 +01:00
traps.c x86/speculation/mds: Revert CPU buffer clear on double fault exit 2019-05-21 18:48:55 +02:00
tsc.c x86/cpu: Sanitize FAM6_ATOM naming 2019-05-14 19:19:34 +02:00
tsc_msr.c x86/tsc: Add missing header to tsc_msr.c 2018-10-03 17:01:45 -07:00
tsc_sync.c
unwind_frame.c x86/unwind: Disable KASAN checks for non-current tasks 2019-05-08 07:19:06 +02:00
unwind_guess.c x86/unwind: Fix guess-unwinder regression 2016-11-28 07:47:54 +01:00
uprobes.c uprobes/x86: Prohibit probing on MOV SS instruction 2019-11-25 09:53:13 +01:00
verify_cpu.S
vm86_32.c x86/vm86/32: Fix POPF emulation 2018-03-22 09:17:59 +01:00
vmlinux.lds.S x86, vmlinux.lds: Page-align end of ..page_aligned sections 2023-04-30 22:09:55 +03:00
vsmp_64.c
x86_init.c x86: Apply more __ro_after_init and const 2016-08-10 14:55:05 +02:00