# git rev-parse -q --verify c7dee506ec3450717e84518ab3a6a3f2ce755cf6^{commit} # git fetch -q -n -f git://gitlab.ozlabs.ibm.com/linuxppc/linux.git next-test # git rev-parse -q --verify c7dee506ec3450717e84518ab3a6a3f2ce755cf6^{commit} c7dee506ec3450717e84518ab3a6a3f2ce755cf6 # git checkout -q -f -B kisskb c7dee506ec3450717e84518ab3a6a3f2ce755cf6 # git clean -qxdf # < git log -1 # commit c7dee506ec3450717e84518ab3a6a3f2ce755cf6 # Author: Michael Ellerman # Date: Tue Aug 31 23:41:15 2021 +1000 # # powerpc/ptdump: Fix generic ptdump for 64-bit # # Since the conversion to generic ptdump we see crashes on 64-bit: # # BUG: Unable to handle kernel data access on read at 0xc0eeff7f00000000 # Faulting instruction address: 0xc00000000045e5fc # Oops: Kernel access of bad area, sig: 11 [#1] # ... # NIP __walk_page_range+0x2bc/0xce0 # LR __walk_page_range+0x240/0xce0 # Call Trace: # __walk_page_range+0x240/0xce0 (unreliable) # walk_page_range_novma+0x74/0xb0 # ptdump_walk_pgd+0x98/0x170 # ptdump_check_wx+0x88/0xd0 # mark_rodata_ro+0x48/0x80 # kernel_init+0x74/0x1a0 # ret_from_kernel_thread+0x5c/0x64 # # What's happening is that have walked off the end of the kernel page # tables, and started dereferencing junk values. # # That happens because we initialised the ptdump_range to span all the way # up to 0xffffffffffffffff: # # static struct ptdump_range ptdump_range[] __ro_after_init = { # {TASK_SIZE_MAX, ~0UL}, # # But the kernel page tables don't span that far. So on 64-bit set the end # of the range to be the address immediately past the end of the kernel # page tables, to limit the page table walk to valid addresses. # # Fixes: e084728393a5 ("powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP") # Reported-by: Nathan Chancellor # Signed-off-by: Michael Ellerman # < /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 c7dee506ec3450717e84518ab3a6a3f2ce755cf6 # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-next-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- randconfig # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_CPU_BIG_ENDIAN=y # Added to kconfig CONFIG_PPC64=y # Added to kconfig CONFIG_PPC_DISABLE_WERROR=y # Added to kconfig CONFIG_SECTION_MISMATCH_WARN_ONLY=y # Added to kconfig CONFIG_PREVENT_FIRMWARE_BUILD=y # Added to kconfig CONFIG_CC_STACKPROTECTOR_STRONG=n # Added to kconfig CONFIG_GCC_PLUGINS=n # Added to kconfig CONFIG_LD_HEAD_STUB_CATCH=y # Added to kconfig CONFIG_TRIM_UNUSED_KSYMS=n # Added to kconfig CONFIG_UBSAN=n # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-next-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-next-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig .config:5140:warning: override: reassigning to symbol CPU_BIG_ENDIAN .config:5140:warning: override: CPU_BIG_ENDIAN changes choice state .config:5143:warning: override: reassigning to symbol SECTION_MISMATCH_WARN_ONLY .config:5144:warning: override: reassigning to symbol PREVENT_FIRMWARE_BUILD .config:5146:warning: override: reassigning to symbol GCC_PLUGINS # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-next-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable.h:310, from /kisskb/src/arch/powerpc/include/asm/book3s/64/mmu-hash.h:20, from /kisskb/src/arch/powerpc/include/asm/book3s/64/mmu.h:32, from /kisskb/src/arch/powerpc/include/asm/mmu.h:395, from /kisskb/src/arch/powerpc/include/asm/lppaca.h:46, from /kisskb/src/arch/powerpc/include/asm/paca.h:17, from /kisskb/src/arch/powerpc/include/asm/current.h:13, from /kisskb/src/include/linux/thread_info.h:23, from /kisskb/src/include/asm-generic/preempt.h:5, from ./arch/powerpc/include/generated/asm/preempt.h:1, from /kisskb/src/include/linux/preempt.h:78, from /kisskb/src/include/linux/spinlock.h:51, from /kisskb/src/include/linux/ipc.h:5, from /kisskb/src/include/uapi/linux/sem.h:5, from /kisskb/src/include/linux/sem.h:5, from /kisskb/src/include/linux/compat.h:14, from /kisskb/src/arch/powerpc/kernel/asm-offsets.c:14: /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable-64k.h: In function 'get_hugepd_cache_index': /kisskb/src/arch/powerpc/include/asm/book3s/64/pgtable-64k.h:60:1: error: no return statement in function returning non-void [-Werror=return-type] 60 | } | ^ cc1: some warnings being treated as errors make[2]: *** [/kisskb/src/scripts/Makefile.build:117: arch/powerpc/kernel/asm-offsets.s] Error 1 make[1]: *** [/kisskb/src/Makefile:1213: prepare0] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:220: __sub-make] Error 2 Command 'make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-next-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/powerpc-next-rand_powerpc-randconfig_powerpc-gcc9 # Build took: 0:00:48.563144