# 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/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < git log --format=%s --max-count=1 61a8426c92ba30d403a1f072e29d713184539cc1 # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-next_ppc44x_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- ppc44x_defconfig # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-next_ppc44x_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- arch/powerpc/boot/dts/katmai.dtb: Warning (pci_bridge): /plb/pciex@d00000000: node name is not "pci" or "pcie" arch/powerpc/boot/dts/katmai.dtb: Warning (pci_bridge): /plb/pciex@d20000000: node name is not "pci" or "pcie" arch/powerpc/boot/dts/katmai.dtb: Warning (pci_bridge): /plb/pciex@d40000000: node name is not "pci" or "pcie" arch/powerpc/boot/dts/katmai.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge' INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5437fc) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x553f14) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:49:46 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2714370 Bytes = 2650.75 KiB = 2.59 MiB Load Address: 00000000 Entry Point: 00000000 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:49:46 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2746276 Bytes = 2681.91 KiB = 2.62 MiB Load Address: 00600000 Entry Point: 00601550 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:49:46 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2746269 Bytes = 2681.90 KiB = 2.62 MiB Load Address: 00600000 Entry Point: 00601520 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:49:46 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2746227 Bytes = 2681.86 KiB = 2.62 MiB Load Address: 00600000 Entry Point: 00601540 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:49:46 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2746289 Bytes = 2681.92 KiB = 2.62 MiB Load Address: 00600000 Entry Point: 00601540 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:49:46 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2746179 Bytes = 2681.82 KiB = 2.62 MiB Load Address: 00600000 Entry Point: 006001c4 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:49:46 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2746322 Bytes = 2681.96 KiB = 2.62 MiB Load Address: 00600000 Entry Point: 00601538 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:49:46 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2746156 Bytes = 2681.79 KiB = 2.62 MiB Load Address: 00600000 Entry Point: 006000d0 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:49:46 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2746227 Bytes = 2681.86 KiB = 2.62 MiB Load Address: 00600000 Entry Point: 00601530 Image Name: Linux-4.20.0-rc2-g61a8426c92ba Created: Thu Dec 13 01:49:46 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2746234 Bytes = 2681.87 KiB = 2.62 MiB Load Address: 00600000 Entry Point: 00601540 Completed OK # rm -rf /kisskb/build/powerpc-next_ppc44x_defconfig_powerpc-gcc5 # Build took: 0:00:53.208545