# git rev-parse -q --verify 51d92826594c3ac1f9b7179a3ab246394a11ecd8^{commit} 51d92826594c3ac1f9b7179a3ab246394a11ecd8 already have revision, skipping fetch # git checkout -q -f -B kisskb 51d92826594c3ac1f9b7179a3ab246394a11ecd8 # git clean -qxdf # < git log -1 # commit 51d92826594c3ac1f9b7179a3ab246394a11ecd8 # Author: Christophe Leroy # Date: Mon Feb 1 06:29:50 2021 +0000 # # powerpc/603: Fix protection of user pages mapped with PROT_NONE # # On book3s/32, page protection is defined by the PP bits in the PTE # which provide the following protection depending on the access # keys defined in the matching segment register: # - PP 00 means RW with key 0 and N/A with key 1. # - PP 01 means RW with key 0 and RO with key 1. # - PP 10 means RW with both key 0 and key 1. # - PP 11 means RO with both key 0 and key 1. # # Since the implementation of kernel userspace access protection, # PP bits have been set as follows: # - PP00 for pages without _PAGE_USER # - PP01 for pages with _PAGE_USER and _PAGE_RW # - PP11 for pages with _PAGE_USER and without _PAGE_RW # # For kernelspace segments, kernel accesses are performed with key 0 # and user accesses are performed with key 1. As PP00 is used for # non _PAGE_USER pages, user can't access kernel pages not flagged # _PAGE_USER while kernel can. # # For userspace segments, both kernel and user accesses are performed # with key 0, therefore pages not flagged _PAGE_USER are still # accessible to the user. # # This shouldn't be an issue, because userspace is expected to be # accessible to the user. But unlike most other architectures, powerpc # implements PROT_NONE protection by removing _PAGE_USER flag instead of # flagging the page as not valid. This means that pages in userspace # that are not flagged _PAGE_USER shall remain inaccessible. # # To get the expected behaviour, just mimic other architectures in the # TLB miss handler by checking _PAGE_USER permission on userspace # accesses as if it was the _PAGE_PRESENT bit. # # Note that this problem only is only for 603 cores. The 604+ have # an hash table, and hash_page() function already implement the # verification of _PAGE_USER permission on userspace pages. # # Fixes: f342adca3afc ("powerpc/32s: Prepare Kernel Userspace Access Protection") # Cc: stable@vger.kernel.org # v5.2+ # Reported-by: Christoph Plattner # Signed-off-by: Christophe Leroy # Signed-off-by: Michael Ellerman # Link: https://lore.kernel.org/r/4a0c6e3bb8f0c162457bf54d9bc6fd8d7b55129f.1612160907.git.christophe.leroy@csgroup.eu # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 51d92826594c3ac1f9b7179a3ab246394a11ecd8 # < make -s -j 32 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc85xx_defconfig # Added to kconfig CONFIG_PPC_E500MC=y # Added to kconfig CONFIG_VIRTUALIZATION=y # Added to kconfig CONFIG_KVM_E500MC=y # Added to kconfig # < make -s -j 32 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 32 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig .config:4183:warning: override: reassigning to symbol PPC_E500MC .config:4184:warning: override: reassigning to symbol VIRTUALIZATION # make -s -j 32 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/drivers/net/phy/phy_device.c:293:12: warning: 'mdio_bus_phy_resume' defined but not used [-Wunused-function] 293 | static int mdio_bus_phy_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/net/phy/phy_device.c:273:12: warning: 'mdio_bus_phy_suspend' defined but not used [-Wunused-function] 273 | static int mdio_bus_phy_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~ In file included from /kisskb/src/include/linux/kernel.h:10, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/module.h:12, 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] 22 | #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) | ^ /kisskb/src/include/linux/compiler.h:78:42: note: in definition of macro 'unlikely' 78 | # 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' 139 | if (IS_ERR_VALUE(fep->ring_mem_addr)) | ^~~~~~~~~~~~ /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8541cds.dts:330.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/mpc8555cds.dts:330.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 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf46c44) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) INFO: Uncompressed kernel (size 0xf36518) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1000000) Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7076331 Bytes = 6910.48 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 0100031c Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7076297 Bytes = 6910.45 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 010002cc Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7078633 Bytes = 6912.73 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 010002cc Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7079076 Bytes = 6913.16 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 010002cc Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7078670 Bytes = 6912.76 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 010002cc Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7076058 Bytes = 6910.21 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 0100031c Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7076407 Bytes = 6910.55 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 0100031c Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7075843 Bytes = 6910.00 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 010002cc Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7076057 Bytes = 6910.21 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 0100031c Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7076318 Bytes = 6910.47 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 010002cc Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7077013 Bytes = 6911.15 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 010002cc Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7076101 Bytes = 6910.25 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 0100031c Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7043702 Bytes = 6878.62 KiB = 6.72 MiB Load Address: 00000000 Entry Point: 00000000 Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7076298 Bytes = 6910.45 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 010002cc Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7078719 Bytes = 6912.81 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 010002cc Image Name: Linux-5.11.0-g51d92826594c Created: Thu Feb 25 01:33:27 2021 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 7076070 Bytes = 6910.22 KiB = 6.75 MiB Load Address: 01000000 Entry Point: 010002cc Completed OK # rm -rf /kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 # Build took: 0:03:12.950586