linux/arch/powerpc/kernel
Ariel Marcovitch 2225a8dda2 powerpc: Fix alignment bug within the init sections
This is a bug that causes early crashes in builds with an .exit.text
section smaller than a page and an .init.text section that ends in the
beginning of a physical page (this is kinda random, which might
explain why this wasn't really encountered before).

The init sections are ordered like this:
  .init.text
  .exit.text
  .init.data

Currently, these sections aren't page aligned.

Because the init code might become read-only at runtime and because
the .init.text section can potentially reside on the same physical
page as .init.data, the beginning of .init.data might be mapped
read-only along with .init.text.

Then when the kernel tries to modify a variable in .init.data (like
kthreadd_done, used in kernel_init()) the kernel panics.

To avoid this, make _einittext page aligned and also align .exit.text
to make sure .init.data is always seperated from the text segments.

Fixes: 060ef9d89d ("powerpc32: PAGE_EXEC required for inittext")
Signed-off-by: Ariel Marcovitch <ariel.marcovitch@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210102201156.10805-1-ariel.marcovitch@gmail.com
2021-01-12 15:06:23 +11:00
..
ptrace
syscalls epoll: wire up syscall epoll_pwait2 2020-12-19 11:18:38 -08:00
trace
vdso32 powerpc/vdso: Don't pass 64-bit ABI cflags to 32-bit VDSO 2020-12-21 22:06:26 +11:00
vdso64 powerpc/vdso: Block R_PPC_REL24 relocations 2020-12-21 22:06:25 +11:00
.gitignore
Makefile
align.c
asm-offsets.c
audit.c
btext.c
cacheinfo.c
cacheinfo.h
compat_audit.c
cpu_setup_6xx.S
cpu_setup_44x.S
cpu_setup_fsl_booke.S
cpu_setup_pa6t.S
cpu_setup_power.c
cpu_setup_ppc970.S
cputable.c
crash_dump.c
dawr.c
dbell.c
dma-iommu.c
dma-mask.c
dma-swiotlb.c
dt_cpu_ftrs.c
early_32.c
eeh.c
eeh_cache.c
eeh_driver.c
eeh_event.c
eeh_pe.c
eeh_sysfs.c
entry_32.S
entry_64.S
epapr_hcalls.S
epapr_paravirt.c
exceptions-64e.S
exceptions-64s.S
fadump.c
firmware.c
fpu.S
fsl_booke_entry_mapping.S
head_8xx.S
head_32.h powerpc/32: Fix vmap stack - Properly set r1 before activating MMU on syscall too 2020-12-21 22:24:00 +11:00
head_40x.S
head_44x.S
head_64.S
head_book3s_32.S powerpc/32s: Fix RTAS machine check with VMAP stack 2021-01-04 23:59:25 +11:00
head_booke.h
head_fsl_booke.S
hw_breakpoint.c
hw_breakpoint_constraints.c
idle.c
idle_6xx.S
idle_book3e.S
idle_book3s.S
idle_e500.S
ima_arch.c
io-workarounds.c
io.c
iomap.c
iommu.c
irq.c
isa-bridge.c
jump_label.c
kgdb.c
kprobes-ftrace.c
kprobes.c
kvm.c
kvm_emul.S
l2cr_6xx.S
legacy_serial.c
mce.c
mce_power.c
misc.S
misc_32.S
misc_64.S
module.c
module_32.c
module_64.c
msi.c
note.S
nvram_64.c
of_platform.c
optprobes.c
optprobes_head.S
paca.c
pci-common.c
pci-hotplug.c
pci_32.c
pci_64.c
pci_dn.c
pci_of_scan.c
pmc.c
ppc32.h
ppc_save_regs.S
proc_powerpc.c
process.c
prom.c
prom_init.c
prom_init_check.sh
prom_parse.c
reloc_32.S
reloc_64.S
rtas-proc.c
rtas-rtc.c
rtas.c
rtas_flash.c
rtas_pci.c
rtasd.c
secure_boot.c
security.c
secvar-ops.c
secvar-sysfs.c
setup-common.c
setup.h
setup_32.c
setup_64.c
signal.c powerpc updates for 5.11 2020-12-17 13:34:25 -08:00
signal.h
signal_32.c
signal_64.c
smp-tbsync.c
smp.c powerpc/smp: Add __init to init_big_cores() 2020-12-21 22:06:10 +11:00
stacktrace.c
suspend.c
swsusp.c
swsusp_32.S
swsusp_64.c
swsusp_asm64.S
swsusp_booke.S
sys_ppc32.c
syscall_64.c
syscalls.c
sysfs.c
systbl.S
systbl_chk.sh
tau_6xx.c
time.c powerpc updates for 5.11 2020-12-17 13:34:25 -08:00
tm.S
traps.c
ucall.S
udbg.c
udbg_16550.c
uprobes.c
vdso.c
vecemu.c
vector.S
vmlinux.lds.S powerpc: Fix alignment bug within the init sections 2021-01-12 15:06:23 +11:00
watchdog.c