syzbot


possible deadlock in seq_read

Status: auto-closed as invalid on 2021/08/31 02:48
Reported-by: syzbot+cf7287166159561d1bb3@syzkaller.appspotmail.com
First crash: 1973d, last: 1298d
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 possible deadlock in seq_read (2) 1 932d 932d 0/1 auto-obsoleted due to no activity on 2022/09/01 16:45
android-44 possible deadlock in seq_read C 632 1814d 2051d 0/2 public: reported C repro on 2019/04/11 08:44
android-49 possible deadlock in seq_read C 56124 1814d 2050d 1/3 public: reported C repro on 2019/04/12 00:00
linux-4.19 possible deadlock in seq_read C error 290 665d 1935d 0/1 upstream: reported C repro on 2019/08/05 16:40
upstream possible deadlock in seq_read (2) overlayfs C done error 95 1512d 2048d 0/28 auto-obsoleted due to no activity on 2022/09/24 20:28
upstream possible deadlock in seq_read fs C 19074 2057d 2547d 12/28 fixed on 2019/04/12 08:05
android-414 possible deadlock in seq_read C 1737 1904d 2051d 0/1 public: reported C repro on 2019/04/11 00:00

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
4.14.232-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.2/12918 is trying to acquire lock:
 (&p->lock){+.+.}, at: [<ffffffff818e979a>] seq_read+0xba/0x1120 fs/seq_file.c:165

but task is already holding lock:
 (sb_writers#3){.+.+}, at: [<ffffffff8186b31f>] file_start_write include/linux/fs.h:2712 [inline]
 (sb_writers#3){.+.+}, at: [<ffffffff8186b31f>] do_sendfile+0x84f/0xb30 fs/read_write.c:1440

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (sb_writers#3){.+.+}:
       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
       sb_start_write include/linux/fs.h:1549 [inline]
       mnt_want_write+0x3a/0xb0 fs/namespace.c:386
       ovl_xattr_set+0x4d/0x290 fs/overlayfs/inode.c:214
       ovl_posix_acl_xattr_set+0x2b7/0x830 fs/overlayfs/super.c:762
       __vfs_setxattr+0xdc/0x130 fs/xattr.c:150
       __vfs_setxattr_noperm+0xfd/0x3d0 fs/xattr.c:181
       __vfs_setxattr_locked+0x14d/0x250 fs/xattr.c:239
       vfs_setxattr+0xcf/0x230 fs/xattr.c:256
       setxattr+0x1a9/0x300 fs/xattr.c:523
       path_setxattr+0x118/0x130 fs/xattr.c:542
       SYSC_setxattr fs/xattr.c:557 [inline]
       SyS_setxattr+0x36/0x50 fs/xattr.c:553
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x46/0xbb

-> #3 (&ovl_i_mutex_dir_key[depth]){++++}:
       down_read+0x36/0x80 kernel/locking/rwsem.c:24
       inode_lock_shared include/linux/fs.h:729 [inline]
       lookup_slow+0x129/0x400 fs/namei.c:1674
       lookup_one_len_unlocked+0x3a0/0x410 fs/namei.c:2595
       ovl_lookup_single+0x33/0x6d0 fs/overlayfs/namei.c:208
       ovl_lookup_layer+0x2ef/0x3d0 fs/overlayfs/namei.c:265
       ovl_lookup+0x5d9/0x1120 fs/overlayfs/namei.c:670
       lookup_slow+0x20a/0x400 fs/namei.c:1696
       walk_component+0x6a1/0xbc0 fs/namei.c:1825
       link_path_walk+0x823/0x10a0 fs/namei.c:2154
       path_parentat+0x41/0x120 fs/namei.c:2398
       filename_parentat+0x176/0x520 fs/namei.c:2420
       SYSC_renameat2 fs/namei.c:4562 [inline]
       SyS_renameat2+0x159/0xad0 fs/namei.c:4533
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x46/0xbb

-> #2 (&ovl_i_mutex_dir_key[depth]#2){++++}:
       down_read+0x36/0x80 kernel/locking/rwsem.c:24
       inode_lock_shared include/linux/fs.h:729 [inline]
       do_last fs/namei.c:3333 [inline]
       path_openat+0x149b/0x2970 fs/namei.c:3569
       do_filp_open+0x179/0x3c0 fs/namei.c:3603
       do_open_execat+0xd3/0x450 fs/exec.c:849
       do_execveat_common+0x711/0x1f30 fs/exec.c:1755
       do_execve fs/exec.c:1860 [inline]
       SYSC_execve fs/exec.c:1941 [inline]
       SyS_execve+0x3b/0x50 fs/exec.c:1936
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x46/0xbb

-> #1 (&sig->cred_guard_mutex){+.+.}:
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
       lock_trace fs/proc/base.c:407 [inline]
       proc_pid_syscall+0xa7/0x2a0 fs/proc/base.c:639
       proc_single_show+0xe7/0x150 fs/proc/base.c:761
       seq_read+0x4cf/0x1120 fs/seq_file.c:237
       do_loop_readv_writev fs/read_write.c:695 [inline]
       do_loop_readv_writev fs/read_write.c:682 [inline]
       do_iter_read+0x3eb/0x5b0 fs/read_write.c:919
       vfs_readv+0xc8/0x120 fs/read_write.c:981
       do_preadv fs/read_write.c:1065 [inline]
       SYSC_preadv fs/read_write.c:1115 [inline]
       SyS_preadv+0x15a/0x200 fs/read_write.c:1110
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x46/0xbb

-> #0 (&p->lock){+.+.}:
       lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
       seq_read+0xba/0x1120 fs/seq_file.c:165
       proc_reg_read+0xee/0x1a0 fs/proc/inode.c:217
       do_loop_readv_writev fs/read_write.c:695 [inline]
       do_loop_readv_writev fs/read_write.c:682 [inline]
       do_iter_read+0x3eb/0x5b0 fs/read_write.c:919
       vfs_readv+0xc8/0x120 fs/read_write.c:981
       kernel_readv fs/splice.c:361 [inline]
       default_file_splice_read+0x418/0x910 fs/splice.c:416
       do_splice_to+0xfb/0x140 fs/splice.c:880
       splice_direct_to_actor+0x207/0x730 fs/splice.c:952
       do_splice_direct+0x164/0x210 fs/splice.c:1061
       do_sendfile+0x47f/0xb30 fs/read_write.c:1441
       SYSC_sendfile64 fs/read_write.c:1502 [inline]
       SyS_sendfile64+0xff/0x110 fs/read_write.c:1488
       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:
  &p->lock --> &ovl_i_mutex_dir_key[depth] --> sb_writers#3

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sb_writers#3);
                               lock(&ovl_i_mutex_dir_key[depth]);
                               lock(sb_writers#3);
  lock(&p->lock);

 *** DEADLOCK ***

1 lock held by syz-executor.2/12918:
 #0:  (sb_writers#3){.+.+}, at: [<ffffffff8186b31f>] file_start_write include/linux/fs.h:2712 [inline]
 #0:  (sb_writers#3){.+.+}, at: [<ffffffff8186b31f>] do_sendfile+0x84f/0xb30 fs/read_write.c:1440

stack backtrace:
CPU: 1 PID: 12918 Comm: syz-executor.2 Not tainted 4.14.232-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
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
 __mutex_lock_common kernel/locking/mutex.c:756 [inline]
 __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
 seq_read+0xba/0x1120 fs/seq_file.c:165
 proc_reg_read+0xee/0x1a0 fs/proc/inode.c:217
 do_loop_readv_writev fs/read_write.c:695 [inline]
 do_loop_readv_writev fs/read_write.c:682 [inline]
 do_iter_read+0x3eb/0x5b0 fs/read_write.c:919
 vfs_readv+0xc8/0x120 fs/read_write.c:981
 kernel_readv fs/splice.c:361 [inline]
 default_file_splice_read+0x418/0x910 fs/splice.c:416
 do_splice_to+0xfb/0x140 fs/splice.c:880
 splice_direct_to_actor+0x207/0x730 fs/splice.c:952
 do_splice_direct+0x164/0x210 fs/splice.c:1061
 do_sendfile+0x47f/0xb30 fs/read_write.c:1441
 SYSC_sendfile64 fs/read_write.c:1502 [inline]
 SyS_sendfile64+0xff/0x110 fs/read_write.c:1488
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x4665f9
RSP: 002b:00007fb3d98d1188 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 000000000056c008 RCX: 00000000004665f9
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 00000000004bfce1 R08: 0000000000000000 R09: 0000000000000000
R10: 4000000000010046 R11: 0000000000000246 R12: 000000000056c008
R13: 00007ffe6931cdcf R14: 00007fb3d98d1300 R15: 0000000000022000
device bridge1 entered promiscuous mode
tmpfs: Bad value 'g4k6k' for mount option 'nr_blocks'
EXT4-fs (loop5): mounted filesystem without journal. Opts: ,errors=continue
device bridge2 entered promiscuous mode
input: syz1 as /devices/virtual/input/input5
input: syz1 as /devices/virtual/input/input6
: renamed from caif0
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface  may have been left with an inconsistent configuration, please check.
overlayfs: unrecognized mount option "lrkdir=./file1" or missing value
overlayfs: unrecognized mount option "lrkdir=./file1" or missing value
EXT4-fs (loop3): VFS: Found ext4 filesystem with invalid superblock checksum.  Run e2fsck?
print_req_error: I/O error, dev loop5, sector 0
Cannot find add_set index 0 as target
Cannot find add_set index 0 as target
device bridge3 entered promiscuous mode
REISERFS warning (device loop5): super-6505 reiserfs_getopt: head of option "resize" is only correct

new mount options do not match the existing superblock, will be ignored
REISERFS warning (device loop5): super-6505 reiserfs_getopt: head of option "resize" is only correct

new mount options do not match the existing superblock, will be ignored
device bridge4 entered promiscuous mode
ntfs: (device nullb0): parse_options(): Unrecognized mount option tmpfs.
overlayfs: fs on './file0' does not support file handles, falling back to index=off.
tmpfs: No value for mount option 'u#¢îX200000000000000060928'
overlayfs: fs on '.' does not support file handles, falling back to index=off.
overlayfs: 'file0' not a directory
9pnet: Could not find request transport: 00000000000000
ntfs: (device nullb0): parse_options(): Unrecognized mount option tmpfs.
overlayfs: filesystem on './bus' not supported as upperdir
tmpfs: No value for mount option 'u#¢îX200000000000000060928'
batman_adv: batadv0: Interface deactivated: batadv_slave_0
batman_adv: batadv0: Removing interface: batadv_slave_0
batman_adv: batadv0: Interface deactivated: batadv_slave_1
batman_adv: batadv0: Removing interface: batadv_slave_1
device team0 left promiscuous mode
device team_slave_0 left promiscuous mode
device team_slave_1 left promiscuous mode
bridge0: port 3(team0) entered disabled state
device bridge_slave_1 left promiscuous mode
bridge0: port 2(bridge_slave_1) entered disabled state
device bridge_slave_0 left promiscuous mode
bridge0: port 1(bridge_slave_0) entered disabled state
device veth1_macvtap left promiscuous mode
device veth0_macvtap left promiscuous mode
device veth1_vlan left promiscuous mode
device veth0_vlan left promiscuous mode
device hsr_slave_1 left promiscuous mode
device hsr_slave_0 left promiscuous mode
team0 (unregistering): Port device team_slave_1 removed
team0 (unregistering): Port device team_slave_0 removed
bond0 (unregistering): Releasing backup interface bond_slave_1
bond0 (unregistering): Releasing backup interface bond_slave_0
bond0 (unregistering): Released all slaves

Crashes (144):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/05/03 02:47 linux-4.14.y 7d7d1c0ab3eb 77e2b668 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/04/30 06:27 linux-4.14.y 7d7d1c0ab3eb 77e2b668 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/04/24 12:29 linux-4.14.y cf256fbcbe34 17f0b706 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/04/19 04:18 linux-4.14.y cf256fbcbe34 7e2b734b .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/04/15 22:26 linux-4.14.y 958e517f4e16 c59079a6 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/04/12 18:13 linux-4.14.y 958e517f4e16 6a81331a .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/04/03 01:49 linux-4.14.y bd634aa64163 6a81331a .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/04/02 11:55 linux-4.14.y bd634aa64163 6a81331a .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/03/26 12:19 linux-4.14.y 670d6552eda8 a8529b82 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/03/24 14:58 linux-4.14.y 670d6552eda8 607e3baf .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/03/09 17:30 linux-4.14.y 1d177c0872ab 26967e35 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/02/26 10:57 linux-4.14.y 3242aa3a635c 4c37c133 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/02/25 23:41 linux-4.14.y 3242aa3a635c 76f7fc95 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/02/25 10:41 linux-4.14.y 3242aa3a635c fcc6d71b .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/02/22 11:57 linux-4.14.y 29c52025152b a659b3f1 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/02/21 10:58 linux-4.14.y 29c52025152b 3e5ed8b4 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/02/20 20:02 linux-4.14.y 29c52025152b 3e5ed8b4 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/01/19 23:38 linux-4.14.y 2762b48e9611 63631df1 .config console log report info ci2-linux-4-14 possible deadlock in seq_read
2021/01/08 20:05 linux-4.14.y 1752938529c6 c104d4a3 .config console log report info ci2-linux-4-14
2020/12/19 02:30 linux-4.14.y 3f2ecb86cb90 04201c06 .config console log report info ci2-linux-4-14
2020/11/15 06:00 linux-4.14.y 27ce4f2a6817 1bf9a662 .config console log report info ci2-linux-4-14
2020/09/24 19:01 linux-4.14.y cbfa1702aaf6 54289b08 .config console log report info ci2-linux-4-14
2020/08/28 12:49 linux-4.14.y d7e78d08fa77 816e0689 .config console log report ci2-linux-4-14
2020/08/25 09:59 linux-4.14.y 6a24ca2506d6 344da168 .config console log report ci2-linux-4-14
2020/08/19 01:49 linux-4.14.y 14b58326976d e1c29030 .config console log report ci2-linux-4-14
2020/08/18 08:36 linux-4.14.y 14b58326976d 5ce13532 .config console log report ci2-linux-4-14
2020/08/10 06:12 linux-4.14.y 14b58326976d 70301872 .config console log report ci2-linux-4-14
2020/07/23 10:02 linux-4.14.y 69b94dd6dcd1 340ea530 .config console log report ci2-linux-4-14
2020/06/15 17:19 linux-4.14.y b850307b279c 8e3ab941 .config console log report ci2-linux-4-14
2020/06/14 09:07 linux-4.14.y b850307b279c a61674a5 .config console log report ci2-linux-4-14
2020/05/31 15:53 linux-4.14.y 4f68020fef1c a0331e89 .config console log report ci2-linux-4-14
2020/05/27 08:40 linux-4.14.y a41ba30d9df2 9072c126 .config console log report ci2-linux-4-14
2020/05/20 02:12 linux-4.14.y ab9dfda23248 6d882fd2 .config console log report ci2-linux-4-14
2020/04/20 21:36 linux-4.14.y c10b57a567e4 347a5dc3 .config console log report ci2-linux-4-14
2020/04/17 20:55 linux-4.14.y c10b57a567e4 435c6d53 .config console log report ci2-linux-4-14
2020/04/16 06:05 linux-4.14.y c10b57a567e4 c743fcb3 .config console log report ci2-linux-4-14
2020/04/14 12:05 linux-4.14.y c10b57a567e4 3f3c5574 .config console log report ci2-linux-4-14
2020/04/13 23:11 linux-4.14.y c10b57a567e4 7c54686a .config console log report ci2-linux-4-14
2020/04/12 18:12 linux-4.14.y 4520f06b03ae 36b0b050 .config console log report ci2-linux-4-14
2020/04/09 01:21 linux-4.14.y 4520f06b03ae a8c6a3f8 .config console log report ci2-linux-4-14
2020/04/08 17:20 linux-4.14.y 4520f06b03ae db9bcd4b .config console log report ci2-linux-4-14
2020/03/31 10:08 linux-4.14.y 01364dad1d45 c8d1cc20 .config console log report ci2-linux-4-14
2020/03/31 02:47 linux-4.14.y 01364dad1d45 c8d1cc20 .config console log report ci2-linux-4-14
2020/03/21 01:51 linux-4.14.y 01364dad1d45 2c31c529 .config console log report ci2-linux-4-14
2020/03/17 11:14 linux-4.14.y 12cd844a39ed 749688d2 .config console log report ci2-linux-4-14
2020/03/11 16:34 linux-4.14.y 78d697fc93f9 e103bc9e .config console log report ci2-linux-4-14
2019/06/28 11:55 linux-4.14.y f4cc0ed9b2c7 7509bf36 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.