# git rev-parse -q --verify cb42033f5d172b5779b6c8301c65693ff6a0a778^{commit} cb42033f5d172b5779b6c8301c65693ff6a0a778 already have revision, skipping fetch # git checkout -q -f -B kisskb cb42033f5d172b5779b6c8301c65693ff6a0a778 # git clean -qxdf # < git log -1 # commit cb42033f5d172b5779b6c8301c65693ff6a0a778 # Author: Christophe Leroy # Date: Mon Mar 11 08:30:38 2019 +0000 # # powerpc/32s: Implement Kernel Userspace Access Protection # # This patch implements Kernel Userspace Access Protection for # book3s/32. # # Due to limitations of the processor page protection capabilities, # the protection is only against writing. read protection cannot be # achieved using page protection. # # The previous patch modifies the page protection so that RW user # pages are RW for Key 0 and RO for Key 1, and it sets Key 0 for # both user and kernel. # # This patch changes userspace segment registers are set to Ku 0 # and Ks 1. When kernel needs to write to RW pages, the associated # segment register is then changed to Ks 0 in order to allow write # access to the kernel. # # In order to avoid having the read all segment registers when # locking/unlocking the access, some data is kept in the thread_struct # and saved on stack on exceptions. The field identifies both the # first unlocked segment and the first segment following the last # unlocked one. When no segment is unlocked, it contains value 0. # # As the hash_page() function is not able to easily determine if a # protfault is due to a bad kernel access to userspace, protfaults # need to be handled by handle_page_fault when KUAP is set. # # Signed-off-by: Christophe Leroy # [mpe: Drop allow_read/write_to/from_user() as they're now in kup.h, # and adapt allow_user_access() to do nothing when to == NULL] # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 cb42033f5d172b5779b6c8301c65693ff6a0a778 # < make -s -j 120 ARCH=powerpc O=/kisskb/build/mpe_mpc85xx_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc85xx_defconfig # make -s -j 120 ARCH=powerpc O=/kisskb/build/mpe_mpc85xx_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- :1478:2: warning: #warning syscall pidfd_send_signal not implemented [-Wcpp] :1481:2: warning: #warning syscall io_uring_setup not implemented [-Wcpp] :1484:2: warning: #warning syscall io_uring_enter not implemented [-Wcpp] :1487:2: warning: #warning syscall io_uring_register not implemented [-Wcpp] In file included from /kisskb/src/include/linux/kernel.h:11:0, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/module.h:9, from /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:15: /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c: In function 'allocate_bd': /kisskb/src/include/linux/err.h:22:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ /kisskb/src/include/linux/compiler.h:77:42: note: in definition of macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:139:6: note: in expansion of macro 'IS_ERR_VALUE' if (IS_ERR_VALUE(fep->ring_mem_addr)) ^ /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8555cds.dts:334.3-21: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8541cds.dts:334.3-21: 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 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbc3830) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbb2ffc) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5793660 Bytes = 5657.87 KiB = 5.53 MiB Load Address: 00c00000 Entry Point: 00c002a4 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5793675 Bytes = 5657.89 KiB = 5.53 MiB Load Address: 00c00000 Entry Point: 00c00314 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5795344 Bytes = 5659.52 KiB = 5.53 MiB Load Address: 00c00000 Entry Point: 00c002a4 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5792960 Bytes = 5657.19 KiB = 5.52 MiB Load Address: 00c00000 Entry Point: 00c00314 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5792969 Bytes = 5657.20 KiB = 5.52 MiB Load Address: 00c00000 Entry Point: 00c002a4 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5793099 Bytes = 5657.32 KiB = 5.52 MiB Load Address: 00c00000 Entry Point: 00c00314 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5794913 Bytes = 5659.09 KiB = 5.53 MiB Load Address: 00c00000 Entry Point: 00c002a4 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5794654 Bytes = 5658.84 KiB = 5.53 MiB Load Address: 00c00000 Entry Point: 00c002a4 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5793098 Bytes = 5657.32 KiB = 5.52 MiB Load Address: 00c00000 Entry Point: 00c002a4 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5793663 Bytes = 5657.87 KiB = 5.53 MiB Load Address: 00c00000 Entry Point: 00c002a4 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5794022 Bytes = 5658.22 KiB = 5.53 MiB Load Address: 00c00000 Entry Point: 00c002a4 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5795523 Bytes = 5659.69 KiB = 5.53 MiB Load Address: 00c00000 Entry Point: 00c002a4 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5792958 Bytes = 5657.19 KiB = 5.52 MiB Load Address: 00c00000 Entry Point: 00c00314 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5795464 Bytes = 5659.63 KiB = 5.53 MiB Load Address: 00c00000 Entry Point: 00c002a4 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5794106 Bytes = 5658.31 KiB = 5.53 MiB Load Address: 00c00000 Entry Point: 00c00314 Image Name: Linux-5.1.0-rc3-gcb42033f5d17 Created: Fri Apr 19 23:25:37 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5764536 Bytes = 5629.43 KiB = 5.50 MiB Load Address: 00000000 Entry Point: 00000000 Completed OK # rm -rf /kisskb/build/mpe_mpc85xx_defconfig_powerpc-gcc5 # Build took: 0:01:13.407118