======================================================
WARNING: possible circular locking dependency detected
5.2.0-next-20190710 #35 Not tainted
------------------------------------------------------
syz-executor.3/8851 is trying to acquire lock:
000000004f506654 (rename_lock#2){+.+.}, at: shrink_dcache_parent+0xb7/0x430 fs/dcache.c:1544
but task is already holding lock:
0000000076f5ef61 (&(&dentry->d_lockref.lock)->rlock){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline]
0000000076f5ef61 (&(&dentry->d_lockref.lock)->rlock){+.+.}, at: shrink_dcache_parent+0x134/0x430 fs/dcache.c:1558
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&(&dentry->d_lockref.lock)->rlock){+.+.}:
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:151
spin_lock include/linux/spinlock.h:338 [inline]
d_set_mounted+0x17e/0x2e0 fs/dcache.c:1434
get_mountpoint+0x166/0x3f0 fs/namespace.c:724
lock_mount+0xf1/0x2e0 fs/namespace.c:2131
do_add_mount+0x27/0x380 fs/namespace.c:2669
do_new_mount_fc fs/namespace.c:2730 [inline]
do_new_mount fs/namespace.c:2785 [inline]
do_mount+0x178f/0x1c30 fs/namespace.c:3103
ksys_mount+0xdb/0x150 fs/namespace.c:3312
devtmpfsd+0xbd/0x130 drivers/base/devtmpfs.c:397
kthread+0x361/0x430 kernel/kthread.c:255
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
-> #0 (rename_lock#2){+.+.}:
check_prev_add kernel/locking/lockdep.c:2405 [inline]
check_prevs_add kernel/locking/lockdep.c:2507 [inline]
validate_chain kernel/locking/lockdep.c:2897 [inline]
__lock_acquire+0x25a9/0x4c30 kernel/locking/lockdep.c:3880
lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4413
seqcount_lockdep_reader_access include/linux/seqlock.h:81 [inline]
read_seqcount_begin include/linux/seqlock.h:164 [inline]
read_seqbegin include/linux/seqlock.h:433 [inline]
read_seqbegin_or_lock include/linux/seqlock.h:529 [inline]
d_walk+0xe8/0x950 fs/dcache.c:1277
shrink_dcache_parent+0xb7/0x430 fs/dcache.c:1544
vfs_rmdir fs/namei.c:3882 [inline]
vfs_rmdir+0x26f/0x4f0 fs/namei.c:3857
do_rmdir+0x39e/0x420 fs/namei.c:3940
__do_sys_rmdir fs/namei.c:3958 [inline]
__se_sys_rmdir fs/namei.c:3956 [inline]
__x64_sys_rmdir+0x36/0x40 fs/namei.c:3956
do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&(&dentry->d_lockref.lock)->rlock);
lock(rename_lock#2);
lock(&(&dentry->d_lockref.lock)->rlock);
lock(rename_lock#2);
*** DEADLOCK ***
4 locks held by syz-executor.3/8851:
#0: 000000000fba99be (sb_writers#3){.+.+}, at: sb_start_write include/linux/fs.h:1625 [inline]
#0: 000000000fba99be (sb_writers#3){.+.+}, at: mnt_want_write+0x3f/0xc0 fs/namespace.c:354
#1: 00000000cd6029c6 (&type->i_mutex_dir_key#3/1){+.+.}, at: inode_lock_nested include/linux/fs.h:813 [inline]
#1: 00000000cd6029c6 (&type->i_mutex_dir_key#3/1){+.+.}, at: do_rmdir+0x271/0x420 fs/namei.c:3928
#2: 00000000fa58b7da (&type->i_mutex_dir_key#3){++++}, at: inode_lock include/linux/fs.h:778 [inline]
#2: 00000000fa58b7da (&type->i_mutex_dir_key#3){++++}, at: vfs_rmdir fs/namei.c:3868 [inline]
#2: 00000000fa58b7da (&type->i_mutex_dir_key#3){++++}, at: vfs_rmdir+0xe5/0x4f0 fs/namei.c:3857
#3: 0000000076f5ef61 (&(&dentry->d_lockref.lock)->rlock){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline]
#3: 0000000076f5ef61 (&(&dentry->d_lockref.lock)->rlock){+.+.}, at: shrink_dcache_parent+0x134/0x430 fs/dcache.c:1558
stack backtrace:
CPU: 0 PID: 8851 Comm: syz-executor.3 Not tainted 5.2.0-next-20190710 #35
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x172/0x1f0 lib/dump_stack.c:113
print_circular_bug.cold+0x163/0x172 kernel/locking/lockdep.c:1617
check_noncircular+0x345/0x3e0 kernel/locking/lockdep.c:1741
check_prev_add kernel/locking/lockdep.c:2405 [inline]
check_prevs_add kernel/locking/lockdep.c:2507 [inline]
validate_chain kernel/locking/lockdep.c:2897 [inline]
__lock_acquire+0x25a9/0x4c30 kernel/locking/lockdep.c:3880
lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4413
seqcount_lockdep_reader_access include/linux/seqlock.h:81 [inline]
read_seqcount_begin include/linux/seqlock.h:164 [inline]
read_seqbegin include/linux/seqlock.h:433 [inline]
read_seqbegin_or_lock include/linux/seqlock.h:529 [inline]
d_walk+0xe8/0x950 fs/dcache.c:1277
shrink_dcache_parent+0xb7/0x430 fs/dcache.c:1544
vfs_rmdir fs/namei.c:3882 [inline]
vfs_rmdir+0x26f/0x4f0 fs/namei.c:3857
do_rmdir+0x39e/0x420 fs/namei.c:3940
__do_sys_rmdir fs/namei.c:3958 [inline]
__se_sys_rmdir fs/namei.c:3956 [inline]
__x64_sys_rmdir+0x36/0x40 fs/namei.c:3956
do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x459537
Code: 00 66 90 b8 57 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 7d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 54 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 5d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffdbbd93cc8 EFLAGS: 00000207 ORIG_RAX: 0000000000000054
RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 0000000000459537
RDX: 0000000000000000 RSI: 0000000000714698 RDI: 00007ffdbbd94e00
RBP: 0000000000001f71 R08: 0000000000000000 R09: 0000000000000001
R10: 000000000000000a R11: 0000000000000207 R12: 00007ffdbbd94e00
R13: 0000555555a5f940 R14: 0000000000000000 R15: 00007ffdbbd94e00
BUG: sleeping function called from invalid context at fs/dcache.c:1551
in_atomic(): 1, irqs_disabled(): 0, pid: 8851, name: syz-executor.3
INFO: lockdep is turned off.
Preemption disabled at:
[<ffffffff81bc3f44>] spin_lock include/linux/spinlock.h:338 [inline]
[<ffffffff81bc3f44>] shrink_dcache_parent+0x134/0x430 fs/dcache.c:1558
CPU: 0 PID: 8851 Comm: syz-executor.3 Not tainted 5.2.0-next-20190710 #35
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x172/0x1f0 lib/dump_stack.c:113
___might_sleep.cold+0x1be/0x1f7 kernel/sched/core.c:6603
shrink_dcache_parent+0xdc/0x430 fs/dcache.c:1551
vfs_rmdir fs/namei.c:3882 [inline]
vfs_rmdir+0x26f/0x4f0 fs/namei.c:3857
do_rmdir+0x39e/0x420 fs/namei.c:3940
__do_sys_rmdir fs/namei.c:3958 [inline]
__se_sys_rmdir fs/namei.c:3956 [inline]
__x64_sys_rmdir+0x36/0x40 fs/namei.c:3956
do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x459537
Code: 00 66 90 b8 57 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 7d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 54 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 5d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffdbbd93cc8 EFLAGS: 00000207 ORIG_RAX: 0000000000000054
RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 0000000000459537
RDX: 0000000000000000 RSI: 0000000000714698 RDI: 00007ffdbbd94e00
RBP: 0000000000001f71 R08: 0000000000000000 R09: 0000000000000001
R10: 000000000000000a R11: 0000000000000207 R12: 00007ffdbbd94e00
R13: 0000555555a5f940 R14: 0000000000000000 R15: 00007ffdbbd94e00
BUG: scheduling while atomic: syz-executor.3/8851/0x00000002
INFO: lockdep is turned off.
Modules linked in:
Preemption disabled at:
[<ffffffff81bc3f44>] spin_lock include/linux/spinlock.h:338 [inline]
[<ffffffff81bc3f44>] shrink_dcache_parent+0x134/0x430 fs/dcache.c:1558