# git rev-parse -q --verify db2628fc86b6586b3224f91a346d49e8befc5a1f^{commit} db2628fc86b6586b3224f91a346d49e8befc5a1f already have revision, skipping fetch # git checkout -q -f -B kisskb db2628fc86b6586b3224f91a346d49e8befc5a1f # git clean -qxdf # < git log -1 # commit db2628fc86b6586b3224f91a346d49e8befc5a1f # Author: Michael Ellerman # Date: Thu Feb 14 15:00:36 2019 +1100 # # powerpc/64s: Fix possible corruption on big endian due to pgd/pud_present() # # In v4.20 we changed our pgd/pud_present() to check for _PAGE_PRESENT # rather than just checking that the value is non-zero, e.g.: # # static inline int pgd_present(pgd_t pgd) # { # - return !pgd_none(pgd); # + return (pgd_raw(pgd) & cpu_to_be64(_PAGE_PRESENT)); # } # # Unfortunately this is broken on big endian, as the result of the # bitwise && is truncated to int, which is always zero because # _PAGE_PRESENT is 0x8000000000000000ul. This means pgd_present() and # pud_present() are always false at compile time, and the compiler # elides the subsequent code. # # Remarkably with that bug present we are still able to boot and run # with few noticeable effects. However under some work loads we are able # to trigger a warning in the ext4 code: # # WARNING: CPU: 11 PID: 29593 at fs/ext4/inode.c:3927 .ext4_set_page_dirty+0x70/0xb0 # CPU: 11 PID: 29593 Comm: debugedit Not tainted 4.20.0-rc1 #1 # ... # NIP .ext4_set_page_dirty+0x70/0xb0 # LR .set_page_dirty+0xa0/0x150 # Call Trace: # .set_page_dirty+0xa0/0x150 # .unmap_page_range+0xbf0/0xe10 # .unmap_vmas+0x84/0x130 # .unmap_region+0xe8/0x190 # .__do_munmap+0x2f0/0x510 # .__vm_munmap+0x80/0x110 # .__se_sys_munmap+0x14/0x30 # system_call+0x5c/0x70 # # The fix is simple, we need to convert the result of the bitwise && to # an int before returning it. # # Thanks to Erhard, Jan Kara and Aneesh for help with debugging. # # Fixes: da7ad366b497 ("powerpc/mm/book3s: Update pmd_present to look at _PAGE_PRESENT bit") # Cc: stable@vger.kernel.org # v4.20+ # Reported-by: Erhard F. # Reviewed-by: Aneesh Kumar K.V # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-ld --version # < git log --format=%s --max-count=1 db2628fc86b6586b3224f91a346d49e8befc5a1f # < make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_powerpc-randconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- randconfig KCONFIG_SEED=0x70A789A8 # 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 # yes \n | make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_powerpc-randconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- oldconfig yes: standard output: Broken pipe # make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_powerpc-randconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /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/lib/mpi/mpicoder.c: In function 'mpi_read_raw_from_sgl': /kisskb/src/lib/mpi/mpicoder.c:352:8: warning: 'buff' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/mm/ksm.c: In function 'stable_node_dup': /kisskb/src/mm/ksm.c:1393:15: warning: 'found_rmap_hlist_len' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/char/tpm/tpm-sysfs.c: In function 'pubek_show': /kisskb/src/drivers/char/tpm/tpm-sysfs.c:37:16: warning: 'tpm_buf.data' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/lib/rhashtable.c: In function 'rhashtable_rehash_one': /kisskb/src/lib/rhashtable.c:264:2: warning: 'next' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/hwspinlock/hwspinlock_core.c: In function 'of_hwspin_lock_get_id': /kisskb/src/drivers/hwspinlock/hwspinlock_core.c:328:6: warning: 'id' may be used uninitialized in this function [-Wuninitialized] /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:339:21: note: 'pdeo' was declared here /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/misc/cxl/native.c: In function 'native_irq_wait': /kisskb/src/drivers/misc/cxl/native.c:1248:2: warning: 'ph' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/misc/cxl/native.c:1248:2: warning: 'dsisr' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/mtd/ubi/eba.c: In function 'try_write_vid_and_data': /kisskb/src/drivers/mtd/ubi/eba.c:1001:7: warning: 'opnum' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/staging/erofs/data.c: In function 'erofs_raw_access_readpages': /kisskb/src/drivers/staging/erofs/data.c:237:18: warning: 'last_block' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/staging/erofs/data.c:378:14: note: 'last_block' was declared here /kisskb/src/drivers/usb/misc/usbtest.c: In function 'test_queue': /kisskb/src/drivers/usb/misc/usbtest.c:2128:1: warning: the frame size of 1216 bytes is larger than 1024 bytes [-Wframe-larger-than=] /kisskb/src/drivers/usb/serial/f81534.c: In function 'f81534_set_register': /kisskb/src/drivers/usb/serial/f81534.c:247:3: warning: 'status' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/usb/serial/f81534.c: In function 'f81534_get_register': /kisskb/src/drivers/usb/serial/f81534.c:286:3: warning: 'status' may be used uninitialized in this function [-Wuninitialized] Completed OK # rm -rf /kisskb/build/powerpc-fixes_powerpc-randconfig_powerpc-gcc4.6 # Build took: 0:01:40.427951