syzbot


possible deadlock in ovl_copy_up_start (3)

Status: auto-obsoleted due to no activity on 2022/12/14 20:28
Reported-by: syzbot+00f2825ba3ea70c970eb@syzkaller.appspotmail.com
First crash: 650d, last: 624d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ovl_copy_up_start (3) overlayfs 1 28d 24d 0/26 closed as dup on 2024/04/08 10:02
linux-4.14 possible deadlock in ovl_copy_up_start (2) 6 835d 885d 0/1 auto-closed as invalid on 2022/05/17 06:42
upstream possible deadlock in ovl_copy_up_start (2) overlayfs 1 219d 215d 0/26 closed as dup on 2023/10/04 08:46
linux-4.14 possible deadlock in ovl_copy_up_start (4) 1 453d 453d 0/1 upstream: reported on 2023/02/03 17:59
linux-4.14 possible deadlock in ovl_copy_up_start 9 1096d 1304d 0/1 auto-closed as invalid on 2021/08/29 09:58
upstream possible deadlock in ovl_copy_up_start overlayfs 2 2015d 2022d 11/26 fixed on 2018/11/12 21:25

Sample crash report:
FAT-fs (loop4): Directory bread(block 6) failed
FAT-fs (loop2): Directory bread(block 6) failed
======================================================
WARNING: possible circular locking dependency detected
4.14.290-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.3/18239 is trying to acquire lock:
 (&oi->lock){+.+.}, at: [<ffffffff82313ca0>] ovl_copy_up_start+0x40/0xe0 fs/overlayfs/util.c:318

but task is already holding lock:
 (sb_writers#6){.+.+}, at: [<ffffffff818e02ea>] sb_start_write include/linux/fs.h:1551 [inline]
 (sb_writers#6){.+.+}, at: [<ffffffff818e02ea>] mnt_want_write+0x3a/0xb0 fs/namespace.c:386

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (sb_writers#6){.+.+}:
       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:1551 [inline]
       mnt_want_write+0x3a/0xb0 fs/namespace.c:386
       ovl_xattr_set+0x4d/0x290 fs/overlayfs/inode.c:214
       __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_lsetxattr fs/xattr.c:564 [inline]
       SyS_lsetxattr+0x33/0x40 fs/xattr.c:560
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x46/0xbb

-> #1 (&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]
       lookup_slow+0x129/0x400 fs/namei.c:1674
       lookup_one_len_unlocked+0x3a0/0x410 fs/namei.c:2595
       ovl_lower_positive+0x184/0x350 fs/overlayfs/namei.c:783
       ovl_rename+0x47c/0xe50 fs/overlayfs/dir.c:968
       vfs_rename+0x560/0x1820 fs/namei.c:4496
       SYSC_renameat2 fs/namei.c:4644 [inline]
       SyS_renameat2+0x95b/0xad0 fs/namei.c:4533
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x46/0xbb

-> #0 (&oi->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
       ovl_copy_up_start+0x40/0xe0 fs/overlayfs/util.c:318
       ovl_copy_up_one+0x21f/0x910 fs/overlayfs/copy_up.c:631
       ovl_copy_up_flags+0xd5/0x120 fs/overlayfs/copy_up.c:686
       ovl_xattr_set+0x18c/0x290 fs/overlayfs/inode.c:227
       __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_lsetxattr fs/xattr.c:564 [inline]
       SyS_lsetxattr+0x33/0x40 fs/xattr.c:560
       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:
  &oi->lock --> &ovl_i_mutex_dir_key[depth]#2 --> sb_writers#6

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sb_writers#6);
                               lock(&ovl_i_mutex_dir_key[depth]#2);
                               lock(sb_writers#6);
  lock(&oi->lock);

 *** DEADLOCK ***

3 locks held by syz-executor.3/18239:
 #0:  (sb_writers#16){.+.+}, at: [<ffffffff818e02ea>] sb_start_write include/linux/fs.h:1551 [inline]
 #0:  (sb_writers#16){.+.+}, at: [<ffffffff818e02ea>] mnt_want_write+0x3a/0xb0 fs/namespace.c:386
 #1:  (&ovl_i_mutex_dir_key[depth]#2){++++}, at: [<ffffffff818f3631>] inode_lock include/linux/fs.h:719 [inline]
 #1:  (&ovl_i_mutex_dir_key[depth]#2){++++}, at: [<ffffffff818f3631>] vfs_setxattr+0xb1/0x230 fs/xattr.c:255
 #2:  (sb_writers#6){.+.+}, at: [<ffffffff818e02ea>] sb_start_write include/linux/fs.h:1551 [inline]
 #2:  (sb_writers#6){.+.+}, at: [<ffffffff818e02ea>] mnt_want_write+0x3a/0xb0 fs/namespace.c:386

stack backtrace:
CPU: 0 PID: 18239 Comm: syz-executor.3 Not tainted 4.14.290-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/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
 __mutex_lock_common kernel/locking/mutex.c:756 [inline]
 __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
 ovl_copy_up_start+0x40/0xe0 fs/overlayfs/util.c:318
 ovl_copy_up_one+0x21f/0x910 fs/overlayfs/copy_up.c:631
 ovl_copy_up_flags+0xd5/0x120 fs/overlayfs/copy_up.c:686
 ovl_xattr_set+0x18c/0x290 fs/overlayfs/inode.c:227
 __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_lsetxattr fs/xattr.c:564 [inline]
 SyS_lsetxattr+0x33/0x40 fs/xattr.c:560
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f20a16ce279
RSP: 002b:00007f20a0043168 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007f20a17e0f80 RCX: 00007f20a16ce279
RDX: 0000000000000000 RSI: 00000000200005c0 RDI: 0000000020000500
RBP: 00007f20a1728189 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc1011b0af R14: 00007f20a0043300 R15: 0000000000022000
FAT-fs (loop4): Directory bread(block 6) failed
FAT-fs (loop4): Directory bread(block 6) failed
FAT-fs (loop4): Directory bread(block 6) failed
FAT-fs (loop2): Directory bread(block 6) failed
FAT-fs (loop4): Directory bread(block 6) failed
FAT-fs (loop4): Directory bread(block 6) failed
FAT-fs (loop4): Directory bread(block 6) failed
FAT-fs (loop2): Directory bread(block 6) failed
FAT-fs (loop2): Directory bread(block 6) failed
FAT-fs (loop2): Directory bread(block 6) failed
kauditd_printk_skb: 22 callbacks suppressed
audit: type=1800 audit(1660681690.931:127): pid=18325 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name="file0" dev="sda1" ino=14989 res=0
bridge0: port 3(team0) entered disabled state
EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue
device team0 left promiscuous mode
device team_slave_0 left promiscuous mode
device team_slave_1 left promiscuous mode
audit: type=1804 audit(1660681690.961:128): pid=18325 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir1536262425/syzkaller.98pIPC/268/file0" dev="sda1" ino=14989 res=1
bridge0: port 3(team0) entered disabled state
audit: type=1326 audit(1660681691.311:129): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18321 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
8021q: adding VLAN 0 to HW filter on device team0
bond0: Enslaving team0 as an active interface with an up link
EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
audit: type=1326 audit(1660681691.321:130): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18321 comm="syz-executor.5" exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=3 compat=0 ip=0x7f446c6b9ebb code=0x50000
device team_slave_1 entered promiscuous mode
audit: type=1326 audit(1660681691.321:131): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18321 comm="syz-executor.5" exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=3 compat=0 ip=0x7f446c6b9ebb code=0x50000
audit: type=1326 audit(1660681691.321:132): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18321 comm="syz-executor.5" exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=3 compat=0 ip=0x7f446c6b9ebb code=0x50000
device team0 left promiscuous mode
audit: type=1326 audit(1660681691.321:133): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18321 comm="syz-executor.5" exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=3 compat=0 ip=0x7f446c6b9ebb code=0x50000
audit: type=1326 audit(1660681691.321:134): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18321 comm="syz-executor.5" exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=3 compat=0 ip=0x7f446c6b9ebb code=0x50000
device team_slave_0 left promiscuous mode
EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue
device team_slave_1 left promiscuous mode
audit: type=1326 audit(1660681691.321:135): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18321 comm="syz-executor.5" exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=3 compat=0 ip=0x7f446c6b9ebb code=0x50000
bridge0: port 3(team0) entered disabled state
audit: type=1326 audit(1660681691.321:136): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18321 comm="syz-executor.5" exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=3 compat=0 ip=0x7f446c6b9ebb code=0x50000
8021q: adding VLAN 0 to HW filter on device team0
EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue
bond0: Enslaving team0 as an active interface with an up link
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode
syz-executor.3 (18374) used greatest stack depth: 23800 bytes left
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
8021q: adding VLAN 0 to HW filter on device team0
bond0: Enslaving team0 as an active interface with an up link
8021q: adding VLAN 0 to HW filter on device team0
bond0: Enslaving team0 as an active interface with an up link
bridge0: port 3(team0) entered disabled state
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
8021q: adding VLAN 0 to HW filter on device team0
bond0: Enslaving team0 as an active interface with an up link
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode
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
8021q: adding VLAN 0 to HW filter on device team0
bond0: Enslaving team0 as an active interface with an up link
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode
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
8021q: adding VLAN 0 to HW filter on device team0
bond0: Enslaving team0 as an active interface with an up link
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
kauditd_printk_skb: 11316 callbacks suppressed
audit: type=1326 audit(1660681695.931:11453): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18432 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
audit: type=1326 audit(1660681695.931:11454): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18432 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
audit: type=1326 audit(1660681695.931:11455): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18432 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
audit: type=1326 audit(1660681695.931:11456): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18432 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
audit: type=1326 audit(1660681695.931:11457): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18432 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
bridge0: port 3(team0) entered disabled state
audit: type=1326 audit(1660681695.931:11458): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18432 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
device team0 entered promiscuous mode
audit: type=1326 audit(1660681695.931:11459): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18432 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
device team_slave_0 entered promiscuous mode
audit: type=1326 audit(1660681695.991:11460): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18432 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
device team_slave_1 entered promiscuous mode
audit: type=1326 audit(1660681695.991:11461): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18432 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
device team0 left promiscuous mode
audit: type=1326 audit(1660681695.991:11462): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=18432 comm=202A3A2A2098FFAD40C353EF7ED58A exe="/root/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f446c707279 code=0x50000
device team_slave_0 left promiscuous mode
device team_slave_1 left promiscuous mode
bridge0: port 3(team0) entered disabled state
8021q: adding VLAN 0 to HW filter on device team0
bond0: Enslaving team0 as an active interface with an up link
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode
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
8021q: adding VLAN 0 to HW filter on device team0
bond0: Enslaving team0 as an active interface with an up link
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
8021q: adding VLAN 0 to HW filter on device team0
bond0: Enslaving team0 as an active interface with an up link
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/08/16 20:28 linux-4.14.y b641242202ed 9e4b39c2 .config console log report info ci2-linux-4-14 possible deadlock in ovl_copy_up_start
2022/07/21 11:05 linux-4.14.y 424a46ea058e 6e67af9d .config console log report info ci2-linux-4-14 possible deadlock in ovl_copy_up_start
* Struck through repros no longer work on HEAD.