# git rev-parse -q --verify 44960f2a7b63e224b1091b3e1d6f60e0cdf4be0c^{commit} 44960f2a7b63e224b1091b3e1d6f60e0cdf4be0c already have revision, skipping fetch # git checkout -q -f -B kisskb 44960f2a7b63e224b1091b3e1d6f60e0cdf4be0c # git clean -qxdf # < git log -1 # commit 44960f2a7b63e224b1091b3e1d6f60e0cdf4be0c # Author: John Stultz # Date: Tue Jul 31 10:17:04 2018 -0700 # # staging: ashmem: Fix SIGBUS crash when traversing mmaped ashmem pages # # Amit Pundir and Youling in parallel reported crashes with recent # mainline kernels running Android: # # F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** # F DEBUG : Build fingerprint: 'Android/db410c32_only/db410c32_only:Q/OC-MR1/102:userdebug/test-key # F DEBUG : Revision: '0' # F DEBUG : ABI: 'arm' # F DEBUG : pid: 2261, tid: 2261, name: zygote >>> zygote <<< # F DEBUG : signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0xec00008 # ... ... # F DEBUG : backtrace: # F DEBUG : #00 pc 00001c04 /system/lib/libc.so (memset+48) # F DEBUG : #01 pc 0010c513 /system/lib/libart.so (create_mspace_with_base+82) # F DEBUG : #02 pc 0015c601 /system/lib/libart.so (art::gc::space::DlMallocSpace::CreateMspace(void*, unsigned int, unsigned int)+40) # F DEBUG : #03 pc 0015c3ed /system/lib/libart.so (art::gc::space::DlMallocSpace::CreateFromMemMap(art::MemMap*, std::__1::basic_string, std::__1::allocator> const&, unsigned int, unsigned int, unsigned int, unsigned int, bool)+36) # ... # # This was bisected back to commit bfd40eaff5ab ("mm: fix # vma_is_anonymous() false-positives"). # # create_mspace_with_base() in the trace above, utilizes ashmem, and with # ashmem, for shared mappings we use shmem_zero_setup(), which sets the # vma->vm_ops to &shmem_vm_ops. But for private ashmem mappings nothing # sets the vma->vm_ops. # # Looking at the problematic patch, it seems to add a requirement that one # call vma_set_anonymous() on a vma, otherwise the dummy_vm_ops will be # used. Using the dummy_vm_ops seem to triggger SIGBUS when traversing # unmapped pages. # # Thus, this patch adds a call to vma_set_anonymous() for ashmem private # mappings and seems to avoid the reported problem. # # Fixes: bfd40eaff5ab ("mm: fix vma_is_anonymous() false-positives") # Cc: Kirill Shutemov # Cc: Andrew Morton # Cc: Dmitry Vyukov # Cc: Oleg Nesterov # Cc: Andrea Arcangeli # Cc: Greg Kroah-Hartman # Cc: Hugh Dickins # Cc: Joel Fernandes # Cc: Colin Cross # Cc: Matthew Wilcox # Reported-by: Amit Pundir # Reported-by: Youling 257 # Signed-off-by: John Stultz # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-gcc --version # < git log --format=%s --max-count=1 44960f2a7b63e224b1091b3e1d6f60e0cdf4be0c # < make -s -j 80 ARCH=sh O=/kisskb/build/linus_sh7785lcr_32bit_defconfig_sh4 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- sh7785lcr_32bit_defconfig # make -s -j 80 ARCH=sh O=/kisskb/build/linus_sh7785lcr_32bit_defconfig_sh4 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- Generating include/generated/machtypes.h :1317:2: warning: #warning syscall pkey_mprotect not implemented [-Wcpp] :1320:2: warning: #warning syscall pkey_alloc not implemented [-Wcpp] :1323:2: warning: #warning syscall pkey_free not implemented [-Wcpp] :1326:2: warning: #warning syscall statx not implemented [-Wcpp] :1332:2: warning: #warning syscall io_pgetevents not implemented [-Wcpp] :1335:2: warning: #warning syscall rseq not implemented [-Wcpp] /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S: Assembler messages: /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S:389: Warning: overflow in branch to syscall_exit_work; converted into longer instruction sequence /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S:392: Warning: overflow in branch to syscall_exit_work; converted into longer instruction sequence /kisskb/src/mm/hugetlb.c: In function 'alloc_pool_huge_page': /kisskb/src/mm/hugetlb.c:1433:5: warning: 'page' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c: In function 'init_srcu_struct_fields': /kisskb/src/kernel/rcu/srcutree.c:127:33: warning: 'levelspread[]' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c:94:6: note: 'levelspread[]' was declared here /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:183:16: warning: 'old' 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/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2497:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1819:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/sh/clk/cpg.c: In function 'r8': /kisskb/src/drivers/sh/clk/cpg.c:41:2: warning: passing argument 1 of 'ioread8' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:29:21: note: expected 'void *' but argument is of type 'const void *' /kisskb/src/drivers/sh/clk/cpg.c: In function 'r16': /kisskb/src/drivers/sh/clk/cpg.c:46:2: warning: passing argument 1 of 'ioread16' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:30:21: note: expected 'void *' but argument is of type 'const void *' /kisskb/src/drivers/sh/clk/cpg.c: In function 'r32': /kisskb/src/drivers/sh/clk/cpg.c:51:2: warning: passing argument 1 of 'ioread32' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:32:21: note: expected 'void *' but argument is of type 'const void *' Image Name: Linux-4.18.0-rc7-g44960f2 Created: Thu Aug 2 05:52:37 2018 Image Type: SuperH Linux Kernel Image (gzip compressed) Data Size: 4077340 Bytes = 3981.78 kB = 3.89 MB Load Address: 80001000 Entry Point: 80002000 Image arch/sh/boot/uImage is ready Completed OK # rm -rf /kisskb/build/linus_sh7785lcr_32bit_defconfig_sh4 # Build took: 0:01:01.352110