# git rev-parse -q --verify c14cbef0319d21339a76247c3061230ae2950a7c^{commit} c14cbef0319d21339a76247c3061230ae2950a7c already have revision, skipping fetch # git checkout -q -f -B kisskb c14cbef0319d21339a76247c3061230ae2950a7c # git clean -qxdf # < git log -1 # commit c14cbef0319d21339a76247c3061230ae2950a7c # Author: Christophe Leroy # Date: Mon Jun 3 08:20:28 2019 +0000 # # powerpc: fix kexec failure on book3s/32 # # In the old days, _PAGE_EXEC didn't exist on 6xx aka book3s/32. # Therefore, allthough __mapin_ram_chunk() was already mapping kernel # text with PAGE_KERNEL_TEXT and the rest with PAGE_KERNEL, the entire # memory was executable. Part of the memory (first 512kbytes) was # mapped with BATs instead of page table, but it was also entirely # mapped as executable. # # In commit 385e89d5b20f ("powerpc/mm: add exec protection on # powerpc 603"), we started adding exec protection to some 6xx, namely # the 603, for pages mapped via pagetables. # # Then, in commit 63b2bc619565 ("powerpc/mm/32s: Use BATs for # STRICT_KERNEL_RWX"), the exec protection was extended to BAT mapped # memory, so that really only the kernel text could be executed. # # The problem here is that kexec is based on copying some code into # upper part of memory then executing it from there in order to install # a fresh new kernel at its definitive location. # # However, the code is position independant and first part of it is # just there to deactivate the MMU and jump to the second part. So it # is possible to run this first part inplace instead of running the # copy. Once the MMU is off, there is no protection anymore and the # second part of the code will just run as before. # # Reported-by: Aaro Koskinen # Fixes: 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX") # Cc: stable@vger.kernel.org # Signed-off-by: Christophe Leroy # Tested-by: Aaro Koskinen # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-ld --version # < git log --format=%s --max-count=1 c14cbef0319d21339a76247c3061230ae2950a7c # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc40x_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- ppc40x_defconfig # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc40x_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:194:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:65:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:331:21: note: 'pdeo' was declared here /kisskb/src/drivers/tty/serial/8250/8250_core.c: In function 'univ8250_release_irq': /kisskb/src/drivers/tty/serial/8250/8250_core.c:247:18: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c:227:19: note: 'i' was declared here INFO: Uncompressed kernel (size 0x54357c) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x54357c) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x54357c) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x54357c) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x532f08) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.2.0-rc2-gc14cbef0319d Created: Fri Jun 7 01:12:17 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2639343 Bytes = 2577.48 KiB = 2.52 MiB Load Address: 00000000 Entry Point: 00000000 Image Name: Linux-5.2.0-rc2-gc14cbef0319d Created: Fri Jun 7 01:12:17 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2671073 Bytes = 2608.47 KiB = 2.55 MiB Load Address: 00600000 Entry Point: 006019cc Image Name: Linux-5.2.0-rc2-gc14cbef0319d Created: Fri Jun 7 01:12:17 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2670554 Bytes = 2607.96 KiB = 2.55 MiB Load Address: 00600000 Entry Point: 00601758 Completed OK # rm -rf /kisskb/build/powerpc-fixes_ppc40x_defconfig_powerpc-gcc4.6 # Build took: 0:00:42.003785