====================================================== WARNING: possible circular locking dependency detected 4.14.288-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/10408 is trying to acquire lock: (sb_writers#6){.+.+}, at: [] file_start_write include/linux/fs.h:2714 [inline] (sb_writers#6){.+.+}, at: [] vfs_fallocate+0x5c1/0x790 fs/open.c:318 but task is already holding lock: (ashmem_mutex){+.+.}, at: [] ashmem_shrink_scan drivers/staging/android/ashmem.c:494 [inline] (ashmem_mutex){+.+.}, at: [] ashmem_ioctl+0x27e/0xd00 drivers/staging/android/ashmem.c:843 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (ashmem_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 ashmem_mmap+0x50/0x5c0 drivers/staging/android/ashmem.c:393 call_mmap include/linux/fs.h:1785 [inline] mmap_region+0xa1a/0x1220 mm/mmap.c:1717 do_mmap+0x5b3/0xcb0 mm/mmap.c:1495 do_mmap_pgoff include/linux/mm.h:2187 [inline] vm_mmap_pgoff+0x14e/0x1a0 mm/util.c:366 SYSC_mmap_pgoff mm/mmap.c:1545 [inline] SyS_mmap_pgoff+0x249/0x510 mm/mmap.c:1503 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #2 (&mm->mmap_sem){++++}: __might_fault mm/memory.c:4700 [inline] __might_fault+0x137/0x1b0 mm/memory.c:4685 _copy_to_user+0x27/0xd0 lib/usercopy.c:25 copy_to_user include/linux/uaccess.h:155 [inline] filldir+0x1d5/0x390 fs/readdir.c:237 dir_emit_dot include/linux/fs.h:3361 [inline] dir_emit_dots include/linux/fs.h:3372 [inline] dcache_readdir+0x180/0x860 fs/libfs.c:192 iterate_dir+0x1a0/0x5e0 fs/readdir.c:52 SYSC_getdents fs/readdir.c:272 [inline] SyS_getdents+0x125/0x240 fs/readdir.c:253 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #1 (&type->i_mutex_dir_key#5){++++}: down_write+0x34/0x90 kernel/locking/rwsem.c:54 inode_lock include/linux/fs.h:719 [inline] do_last fs/namei.c:3331 [inline] path_openat+0xde2/0x2970 fs/namei.c:3569 do_filp_open+0x179/0x3c0 fs/namei.c:3603 do_sys_open+0x296/0x410 fs/open.c:1081 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #0 (sb_writers#6){.+.+}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x64/0x260 fs/super.c:1342 file_start_write include/linux/fs.h:2714 [inline] vfs_fallocate+0x5c1/0x790 fs/open.c:318 ashmem_shrink_scan.part.0+0x135/0x3d0 drivers/staging/android/ashmem.c:501 ashmem_shrink_scan drivers/staging/android/ashmem.c:494 [inline] ashmem_ioctl+0x294/0xd00 drivers/staging/android/ashmem.c:843 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb other info that might help us debug this: Chain exists of: sb_writers#6 --> &mm->mmap_sem --> ashmem_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(ashmem_mutex); lock(&mm->mmap_sem); lock(ashmem_mutex); lock(sb_writers#6); *** DEADLOCK *** 1 lock held by syz-executor.1/10408: #0: (ashmem_mutex){+.+.}, at: [] ashmem_shrink_scan drivers/staging/android/ashmem.c:494 [inline] #0: (ashmem_mutex){+.+.}, at: [] ashmem_ioctl+0x27e/0xd00 drivers/staging/android/ashmem.c:843 stack backtrace: CPU: 0 PID: 10408 Comm: syz-executor.1 Not tainted 4.14.288-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x64/0x260 fs/super.c:1342 file_start_write include/linux/fs.h:2714 [inline] vfs_fallocate+0x5c1/0x790 fs/open.c:318 ashmem_shrink_scan.part.0+0x135/0x3d0 drivers/staging/android/ashmem.c:501 ashmem_shrink_scan drivers/staging/android/ashmem.c:494 [inline] ashmem_ioctl+0x294/0xd00 drivers/staging/android/ashmem.c:843 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7f98cd42c199 RSP: 002b:00007f98cbda1168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f98cd53ef60 RCX: 00007f98cd42c199 RDX: 0000000000000000 RSI: 000000000000770a RDI: 0000000000000004 RBP: 00007f98cd48613b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff8601749f R14: 00007f98cbda1300 R15: 0000000000022000 audit: type=1800 audit(1658164327.503:8): pid=10504 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name="file0" dev="sda1" ino=14029 res=0 audit: type=1804 audit(1658164327.503:9): pid=10504 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir2770919469/syzkaller.L6oUmN/37/file0" dev="sda1" ino=14029 res=1 program syz-executor.2 is using a deprecated SCSI ioctl, please convert it to SG_IO sd 0:0:1:0: ioctl_internal_command: ILLEGAL REQUEST asc=0x20 ascq=0x0 xt_policy: neither incoming nor outgoing policy selected program syz-executor.2 is using a deprecated SCSI ioctl, please convert it to SG_IO sd 0:0:1:0: ioctl_internal_command: ILLEGAL REQUEST asc=0x20 ascq=0x0 program syz-executor.1 is using a deprecated SCSI ioctl, please convert it to SG_IO sd 0:0:1:0: ioctl_internal_command: ILLEGAL REQUEST asc=0x20 ascq=0x0 program syz-executor.2 is using a deprecated SCSI ioctl, please convert it to SG_IO sd 0:0:1:0: ioctl_internal_command: ILLEGAL REQUEST asc=0x20 ascq=0x0 audit: type=1800 audit(1658164328.383:10): pid=10589 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name="file0" dev="sda1" ino=14052 res=0 audit: type=1804 audit(1658164328.383:11): pid=10589 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir2770919469/syzkaller.L6oUmN/38/file0" dev="sda1" ino=14052 res=1 audit: type=1800 audit(1658164328.793:12): pid=10609 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="file0" dev="sda1" ino=14016 res=0 audit: type=1800 audit(1658164328.793:13): pid=10610 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="file0" dev="sda1" ino=14017 res=0 audit: type=1804 audit(1658164328.853:14): pid=10595 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir830492477/syzkaller.z2cQE1/35/file0" dev="sda1" ino=14017 res=1 audit: type=1804 audit(1658164328.853:15): pid=10609 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.4" name="/root/syzkaller-testdir317197975/syzkaller.MyJwO1/27/file0" dev="sda1" ino=14016 res=1 audit: type=1800 audit(1658164329.413:16): pid=10630 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name="file0" dev="sda1" ino=14012 res=0 sg_write: process 107 (syz-executor.5) called from kernel context, this is not allowed. audit: type=1800 audit(1658164329.703:17): pid=10631 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="file0" dev="sda1" ino=14014 res=0 nla_parse: 2557 callbacks suppressed netlink: 4 bytes leftover after parsing attributes in process `syz-executor.1'. audit: type=1804 audit(1658164329.703:18): pid=10628 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir2770919469/syzkaller.L6oUmN/39/file0" dev="sda1" ino=14012 res=1 netlink: 12 bytes leftover after parsing attributes in process `syz-executor.1'. audit: type=1804 audit(1658164329.713:19): pid=10631 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir830492477/syzkaller.z2cQE1/36/file0" dev="sda1" ino=14014 res=1 netlink: 4 bytes leftover after parsing attributes in process `syz-executor.1'. audit: type=1800 audit(1658164330.313:20): pid=10647 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name="file0" dev="sda1" ino=14052 res=0 netlink: 12 bytes leftover after parsing attributes in process `syz-executor.1'. BTRFS: device fsid e76ed352-74d7-4461-bdaa-670e3acfe92b devid 1 transid 7 /dev/loop3 audit: type=1800 audit(1658164330.523:21): pid=10648 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="file0" dev="sda1" ino=14053 res=0 BTRFS error (device loop3): unsupported checksum algorithm 3 netlink: 4 bytes leftover after parsing attributes in process `syz-executor.1'. BTRFS error (device loop3): superblock checksum mismatch netlink: 12 bytes leftover after parsing attributes in process `syz-executor.1'. BTRFS error (device loop3): open_ctree failed netlink: 4 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.1'. BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch BTRFS error (device loop3): open_ctree failed BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch BTRFS error (device loop3): open_ctree failed BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch BTRFS error (device loop3): open_ctree failed IPVS: ftp: loaded support on port[0] = 21 BTRFS: device fsid ee883037-9d30-4c68-a7f1-5937e6a18f26 devid 1 transid 7 /dev/loop0 BTRFS error (device loop0): unsupported checksum algorithm 1 BTRFS error (device loop0): superblock checksum mismatch BTRFS error (device loop0): open_ctree failed kauditd_printk_skb: 6 callbacks suppressed audit: type=1804 audit(1658164335.974:28): pid=11061 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir2770919469/syzkaller.L6oUmN/60/cgroup.controllers" dev="sda1" ino=14103 res=1 audit: type=1804 audit(1658164336.094:29): pid=11077 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir2770919469/syzkaller.L6oUmN/61/cgroup.controllers" dev="sda1" ino=14029 res=1 audit: type=1804 audit(1658164336.284:30): pid=11105 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir2770919469/syzkaller.L6oUmN/62/cgroup.controllers" dev="sda1" ino=14083 res=1