# git rev-parse -q --verify 61a8426c92ba30d403a1f072e29d713184539cc1^{commit} 61a8426c92ba30d403a1f072e29d713184539cc1 already have revision, skipping fetch # git checkout -q -f -B kisskb 61a8426c92ba30d403a1f072e29d713184539cc1 # git clean -qxdf # < git log -1 # commit 61a8426c92ba30d403a1f072e29d713184539cc1 # Author: Aneesh Kumar K.V # Date: Mon Nov 26 20:05:04 2018 +0530 # # powerpc/mm/hash: Handle user access of kernel address gracefully # # In commit 2865d08dd9ea ("powerpc/mm: Move the DSISR_PROTFAULT sanity # check") we moved the protection fault access check before the vma # lookup. That means we hit that WARN_ON when user space accesses a # kernel address. Before that commit this was handled by find_vma() not # finding vma for the kernel address and considering that access as bad # area access. # # Avoid the confusing WARN_ON and convert that to a ratelimited printk. # # With the patch we now get: # # for load: # a.out[5997]: User access of kernel address (c00000000000dea0) - exploit attempt? (uid: 1000) # a.out[5997]: segfault (11) at c00000000000dea0 nip 1317c0798 lr 7fff80d6441c code 1 in a.out[1317c0000+10000] # a.out[5997]: code: 60000000 60420000 3c4c0002 38427790 4bffff20 3c4c0002 38427784 fbe1fff8 # a.out[5997]: code: f821ffc1 7c3f0b78 60000000 e9228030 <89290000> 993f002f 60000000 383f0040 # # for exec: # a.out[6067]: User access of kernel address (c00000000000dea0) - exploit attempt? (uid: 1000) # a.out[6067]: segfault (11) at c00000000000dea0 nip c00000000000dea0 lr 129d507b0 code 1 # a.out[6067]: Bad NIP, not dumping instructions. # # Fixes: 2865d08dd9ea ("powerpc/mm: Move the DSISR_PROTFAULT sanity check") # Signed-off-by: Aneesh Kumar K.V # Tested-by: Breno Leitao # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < git log --format=%s --max-count=1 61a8426c92ba30d403a1f072e29d713184539cc1 # < make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc85xx_defconfig_powerpc CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- mpc85xx_defconfig # make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc85xx_defconfig_powerpc CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /kisskb/src/kernel/cgroup/cgroup-v1.c: In function 'cgroup1_mount': /kisskb/src/kernel/cgroup/cgroup-v1.c:1256:20: warning: 'root' 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:186:16: warning: 'old' 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:2594: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:1855:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/mm/hugetlb.c: In function 'alloc_pool_huge_page': /kisskb/src/mm/hugetlb.c:1433:5: warning: 'page' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/sound/soc/codecs/wm8960.c: In function 'wm8960_configure_clocking': /kisskb/src/sound/soc/codecs/wm8960.c:803:70: warning: 'j' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/sound/soc/codecs/wm8960.c:800:68: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/i2c/i2c-core-base.c: In function 'i2c_generic_scl_recovery': /kisskb/src/drivers/i2c/i2c-core-base.c:235:5: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c: In function 'allocate_bd': /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:139:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /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:341: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 /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] arch/powerpc/boot/dts/fsl/mpc8541cds.dtb: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) arch/powerpc/boot/dts/fsl/mpc8555cds.dtb: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb99940) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xb891b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:55 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5600943 Bytes = 5469.67 KiB = 5.34 MiB Load Address: 00000000 Entry Point: 00000000 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:55 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5632689 Bytes = 5500.67 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002b4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:56 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5631013 Bytes = 5499.04 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002b4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:56 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5632347 Bytes = 5500.34 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002b4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5631043 Bytes = 5499.07 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002f4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5632694 Bytes = 5500.68 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002b4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5631190 Bytes = 5499.21 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002b4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5630964 Bytes = 5498.99 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002b4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5630913 Bytes = 5498.94 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002b4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5631009 Bytes = 5499.03 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002b4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5631003 Bytes = 5499.03 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002f4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5631007 Bytes = 5499.03 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002b4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5630961 Bytes = 5498.99 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002f4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5630911 Bytes = 5498.94 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002f4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5630963 Bytes = 5498.99 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002f4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:14:57 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5630938 Bytes = 5498.96 KiB = 5.37 MiB Load Address: 00c00000 Entry Point: 00c002b4 Completed OK # rm -rf /kisskb/build/powerpc-next_mpc85xx_defconfig_powerpc # Build took: 0:01:46.844850