# 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 24 ARCH=powerpc O=/kisskb/build/powerpc-fixes_pseries_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- pseries_defconfig # make -s -j 24 ARCH=powerpc O=/kisskb/build/powerpc-fixes_pseries_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /kisskb/src/mm/hugetlb.c: In function 'alloc_pool_huge_page': /kisskb/src/mm/hugetlb.c:1465:5: warning: 'page' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2589:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1850:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /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/net/bridge/br_netlink.c: In function 'br_afspec.isra.28': /kisskb/src/net/bridge/br_netlink.c:652:7: warning: 'err' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/nfsd/nfs4xdr.c: In function 'nfsd4_encode_components_esc': /kisskb/src/fs/nfsd/nfs4xdr.c:2077:9: warning: 'str' 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/fs/udf/unicode.c: In function 'udf_name_conv_char': /kisskb/src/fs/udf/unicode.c:132:8: warning: 'c' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/futex.c: In function 'do_futex': /kisskb/src/kernel/futex.c:1658:3: warning: 'oldval' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/futex.c:1633:6: note: 'oldval' was declared here /kisskb/src/net/core/devlink.c: In function 'devlink_fmsg_snd.constprop.72': /kisskb/src/net/core/devlink.c:4394:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/tun.c: In function 'tun_get_user': /kisskb/src/drivers/net/tun.c:1851:30: warning: 'copylen' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/tun.c:1764:46: warning: 'linear' may be used uninitialized in this function [-Wuninitialized] /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 WARNING: vmlinux.o(.text+0x362a): Section mismatch in reference from the variable start_here_multiplatform to the function .init.text:.early_setup() The function start_here_multiplatform() references the function __init .early_setup(). This is often because start_here_multiplatform lacks a __init annotation or the annotation of .early_setup is wrong. Completed OK # rm -rf /kisskb/build/powerpc-fixes_pseries_defconfig_powerpc-gcc4.6 # Build took: 0:02:58.257601