possible deadlock in proc_tgid_io_accounting

10 views
Skip to first unread message

syzbot

unread,
Aug 3, 2020, 3:18:21 PM8/3/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7f2c5eb4 Linux 4.14.191
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14b8690a900000
kernel config: https://syzkaller.appspot.com/x/.config?x=881f1aee9620bf9f
dashboard link: https://syzkaller.appspot.com/bug?extid=1a6d6e76ff4c5f8008e3
compiler: gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+1a6d6e...@syzkaller.appspotmail.com

device lo entered promiscuous mode
======================================================
WARNING: possible circular locking dependency detected
4.14.191-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.4/18995 is trying to acquire lock:
(&sig->cred_guard_mutex){+.+.}, at: [<ffffffff81a69d29>] do_io_accounting fs/proc/base.c:2726 [inline]
(&sig->cred_guard_mutex){+.+.}, at: [<ffffffff81a69d29>] proc_tgid_io_accounting+0x1b9/0x7a0 fs/proc/base.c:2775

but task is already holding lock:
(&p->lock){+.+.}, at: [<ffffffff81950fba>] seq_read+0xba/0x1120 fs/seq_file.c:165

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&p->lock){+.+.}:
__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
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

-> #2 (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+0x19a/0x2e0 fs/super.c:1363
sb_start_write include/linux/fs.h:1549 [inline]
mnt_want_write+0x3a/0xb0 fs/namespace.c:386
ovl_do_remove+0x65/0xaf0 fs/overlayfs/dir.c:759
vfs_rmdir.part.0+0x144/0x390 fs/namei.c:3908
vfs_rmdir fs/namei.c:3893 [inline]
do_rmdir+0x334/0x3c0 fs/namei.c:3968
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]){++++}:
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:1742
do_execve fs/exec.c:1847 [inline]
SYSC_execve fs/exec.c:1928 [inline]
SyS_execve+0x3b/0x50 fs/exec.c:1923
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

-> #0 (&sig->cred_guard_mutex){+.+.}:
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
do_io_accounting fs/proc/base.c:2726 [inline]
proc_tgid_io_accounting+0x1b9/0x7a0 fs/proc/base.c:2775
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
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:
&sig->cred_guard_mutex --> sb_writers#3 --> &p->lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&p->lock);
lock(sb_writers#3);
lock(&p->lock);
lock(&sig->cred_guard_mutex);

*** DEADLOCK ***

1 lock held by syz-executor.4/18995:
#0: (&p->lock){+.+.}, at: [<ffffffff81950fba>] seq_read+0xba/0x1120 fs/seq_file.c:165

stack backtrace:
CPU: 0 PID: 18995 Comm: syz-executor.4 Not tainted 4.14.191-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/0x283 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
do_io_accounting fs/proc/base.c:2726 [inline]
proc_tgid_io_accounting+0x1b9/0x7a0 fs/proc/base.c:2775
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
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:0x45cc79
RSP: 002b:00007fecfbc7dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000026b80 RCX: 000000000045cc79
RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000006
RBP: 000000000078bf48 R08: 0000000000000000 R09: 0000000000000000
R10: 20000000000000d8 R11: 0000000000000246 R12: 000000000078bf0c
R13: 00007ffe0b95e4ef R14: 00007fecfbc7e9c0 R15: 000000000078bf0c
libceph: connect [d::]:6789 error -101
libceph: mon0 [d::]:6789 connect error
FAT-fs (loop2): Unrecognized mount option "�" or missing value
kauditd_printk_skb: 1 callbacks suppressed
audit: type=1800 audit(1596482244.527:63): pid=19023 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name="bus" dev="sda1" ino=16329 res=0
audit: type=1400 audit(1596482244.897:64): avc: denied { set_context_mgr } for pid=19060 comm="syz-executor.5" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=binder permissive=1
IPv6: ADDRCONF(NETDEV_UP): bridge0: link is not ready
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
8021q: adding VLAN 0 to HW filter on device bond0
IPv6: ADDRCONF(NETDEV_UP): team0: link is not ready
8021q: adding VLAN 0 to HW filter on device team0
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 caif0 may have been left with an inconsistent configuration, please check.
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
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 caif0 may have been left with an inconsistent configuration, please check.
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
libceph: connect [d::]:6789 error -101
libceph: mon0 [d::]:6789 connect error
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
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 caif0 may have been left with an inconsistent configuration, please check.
FAULT_INJECTION: forcing a failure.
name fail_page_alloc, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 19140 Comm: syz-executor.0 Not tainted 4.14.191-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/0x283 lib/dump_stack.c:58
fail_dump lib/fault-inject.c:51 [inline]
should_fail.cold+0x10a/0x154 lib/fault-inject.c:149
should_fail_alloc_page mm/page_alloc.c:2892 [inline]
prepare_alloc_pages mm/page_alloc.c:4125 [inline]
__alloc_pages_nodemask+0x22c/0x2720 mm/page_alloc.c:4173
alloc_pages_current+0x155/0x260 mm/mempolicy.c:2113
alloc_pages include/linux/gfp.h:520 [inline]
__page_cache_alloc mm/filemap.c:871 [inline]
pagecache_get_page+0x3f5/0xab0 mm/filemap.c:1501
grab_cache_page_write_begin+0x63/0x90 mm/filemap.c:2997
block_write_begin+0x33/0x270 fs/buffer.c:2143
cont_write_begin+0x497/0x730 fs/buffer.c:2497
fat_write_begin+0x89/0x170 fs/fat/inode.c:222
generic_perform_write+0x1c9/0x420 mm/filemap.c:3047
__generic_file_write_iter+0x227/0x590 mm/filemap.c:3172
generic_file_write_iter+0x36f/0x650 mm/filemap.c:3200
call_write_iter include/linux/fs.h:1778 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x44c/0x630 fs/read_write.c:482
vfs_write+0x17f/0x4d0 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xf2/0x210 fs/read_write.c:582
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45cc79
RSP: 002b:00007f1de4bf8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000037f80 RCX: 000000000045cc79
RDX: 00000000175d900f RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00007f1de4bf8ca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc783b2e0f R14: 00007f1de4bf99c0 R15: 000000000078bf0c
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
CPU: 1 PID: 19161 Comm: syz-executor.0 Not tainted 4.14.191-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/0x283 lib/dump_stack.c:58
fail_dump lib/fault-inject.c:51 [inline]
should_fail.cold+0x10a/0x154 lib/fault-inject.c:149
should_failslab+0xd6/0x130 mm/failslab.c:32
slab_pre_alloc_hook mm/slab.h:421 [inline]
slab_alloc mm/slab.c:3376 [inline]
kmem_cache_alloc+0x28e/0x3c0 mm/slab.c:3550
kmem_cache_zalloc include/linux/slab.h:651 [inline]
alloc_buffer_head+0x20/0x110 fs/buffer.c:3436
alloc_page_buffers+0xb3/0x1f0 fs/buffer.c:874
create_empty_buffers+0x36/0x450 fs/buffer.c:1590
create_page_buffers+0x14d/0x1c0 fs/buffer.c:1707
__block_write_begin_int+0x176/0x1090 fs/buffer.c:2017
__block_write_begin fs/buffer.c:2088 [inline]
block_write_begin+0x58/0x270 fs/buffer.c:2147
cont_write_begin+0x497/0x730 fs/buffer.c:2497
fat_write_begin+0x89/0x170 fs/fat/inode.c:222
generic_perform_write+0x1c9/0x420 mm/filemap.c:3047
__generic_file_write_iter+0x227/0x590 mm/filemap.c:3172
generic_file_write_iter+0x36f/0x650 mm/filemap.c:3200
call_write_iter include/linux/fs.h:1778 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x44c/0x630 fs/read_write.c:482
vfs_write+0x17f/0x4d0 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xf2/0x210 fs/read_write.c:582
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45cc79
RSP: 002b:00007f1de4bf8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000037f80 RCX: 000000000045cc79
RDX: 00000000175d900f RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00007f1de4bf8ca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc783b2e0f R14: 00007f1de4bf99c0 R15: 000000000078bf0c
libceph: connect [d::]:6789 error -101
libceph: mon0 [d::]:6789 connect error
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
CPU: 0 PID: 19186 Comm: syz-executor.0 Not tainted 4.14.191-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/0x283 lib/dump_stack.c:58
fail_dump lib/fault-inject.c:51 [inline]
should_fail.cold+0x10a/0x154 lib/fault-inject.c:149
should_failslab+0xd6/0x130 mm/failslab.c:32
slab_pre_alloc_hook mm/slab.h:421 [inline]
slab_alloc mm/slab.c:3376 [inline]
kmem_cache_alloc+0x28e/0x3c0 mm/slab.c:3550
kmem_cache_zalloc include/linux/slab.h:651 [inline]
alloc_buffer_head+0x20/0x110 fs/buffer.c:3436
alloc_page_buffers+0xb3/0x1f0 fs/buffer.c:874
create_empty_buffers+0x36/0x450 fs/buffer.c:1590
create_page_buffers+0x14d/0x1c0 fs/buffer.c:1707
__block_write_begin_int+0x176/0x1090 fs/buffer.c:2017
__block_write_begin fs/buffer.c:2088 [inline]
block_write_begin+0x58/0x270 fs/buffer.c:2147
cont_write_begin+0x497/0x730 fs/buffer.c:2497
fat_write_begin+0x89/0x170 fs/fat/inode.c:222
generic_perform_write+0x1c9/0x420 mm/filemap.c:3047
__generic_file_write_iter+0x227/0x590 mm/filemap.c:3172
generic_file_write_iter+0x36f/0x650 mm/filemap.c:3200
call_write_iter include/linux/fs.h:1778 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x44c/0x630 fs/read_write.c:482
vfs_write+0x17f/0x4d0 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xf2/0x210 fs/read_write.c:582
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45cc79
RSP: 002b:00007f1de4bf8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000037f80 RCX: 000000000045cc79
RDX: 00000000175d900f RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00007f1de4bf8ca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00007ffc783b2e0f R14: 00007f1de4bf99c0 R15: 000000000078bf0c
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 caif0 may have been left with an inconsistent configuration, please check.
libceph: connect [d::]:6789 error -101
libceph: mon0 [d::]:6789 connect error
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
caif:caif_disconnect_client(): nothing to disconnect
CPU: 0 PID: 19242 Comm: syz-executor.0 Not tainted 4.14.191-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/0x283 lib/dump_stack.c:58
fail_dump lib/fault-inject.c:51 [inline]
should_fail.cold+0x10a/0x154 lib/fault-inject.c:149
should_failslab+0xd6/0x130 mm/failslab.c:32
slab_pre_alloc_hook mm/slab.h:421 [inline]
slab_alloc mm/slab.c:3376 [inline]
kmem_cache_alloc+0x28e/0x3c0 mm/slab.c:3550
kmem_cache_zalloc include/linux/slab.h:651 [inline]
alloc_buffer_head+0x20/0x110 fs/buffer.c:3436
alloc_page_buffers+0xb3/0x1f0 fs/buffer.c:874
create_empty_buffers+0x36/0x450 fs/buffer.c:1590
create_page_buffers+0x14d/0x1c0 fs/buffer.c:1707
__block_write_begin_int+0x176/0x1090 fs/buffer.c:2017
__block_write_begin fs/buffer.c:2088 [inline]
block_write_begin+0x58/0x270 fs/buffer.c:2147
cont_write_begin+0x497/0x730 fs/buffer.c:2497
fat_write_begin+0x89/0x170 fs/fat/inode.c:222
generic_perform_write+0x1c9/0x420 mm/filemap.c:3047
__generic_file_write_iter+0x227/0x590 mm/filemap.c:3172
generic_file_write_iter+0x36f/0x650 mm/filemap.c:3200
call_write_iter include/linux/fs.h:1778 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x44c/0x630 fs/read_write.c:482
vfs_write+0x17f/0x4d0 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xf2/0x210 fs/read_write.c:582
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45cc79
RSP: 002b:00007f1de4bf8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000037f80 RCX: 000000000045cc79
RDX: 00000000175d900f RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00007f1de4bf8ca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 00007ffc783b2e0f R14: 00007f1de4bf99c0 R15: 000000000078bf0c
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 caif0 may have been left with an inconsistent configuration, please check.
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 0 PID: 19278 Comm: syz-executor.0 Not tainted 4.14.191-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/0x283 lib/dump_stack.c:58
fail_dump lib/fault-inject.c:51 [inline]
should_fail.cold+0x10a/0x154 lib/fault-inject.c:149
should_failslab+0xd6/0x130 mm/failslab.c:32
slab_pre_alloc_hook mm/slab.h:421 [inline]
slab_alloc mm/slab.c:3376 [inline]
kmem_cache_alloc+0x28e/0x3c0 mm/slab.c:3550
kmem_cache_zalloc include/linux/slab.h:651 [inline]
alloc_buffer_head+0x20/0x110 fs/buffer.c:3436
alloc_page_buffers+0xb3/0x1f0 fs/buffer.c:874
create_empty_buffers+0x36/0x450 fs/buffer.c:1590
create_page_buffers+0x14d/0x1c0 fs/buffer.c:1707
__block_write_begin_int+0x176/0x1090 fs/buffer.c:2017
__block_write_begin fs/buffer.c:2088 [inline]
block_write_begin+0x58/0x270 fs/buffer.c:2147
cont_write_begin+0x497/0x730 fs/buffer.c:2497
fat_write_begin+0x89/0x170 fs/fat/inode.c:222
generic_perform_write+0x1c9/0x420 mm/filemap.c:3047
__generic_file_write_iter+0x227/0x590 mm/filemap.c:3172
generic_file_write_iter+0x36f/0x650 mm/filemap.c:3200
call_write_iter include/linux/fs.h:1778 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x44c/0x630 fs/read_write.c:482
vfs_write+0x17f/0x4d0 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xf2/0x210 fs/read_write.c:582
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45cc79
RSP: 002b:00007f1de4bf8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000037f80 RCX: 000000000045cc79
RDX: 00000000175d900f RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00007f1de4bf8ca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004
R13: 00007ffc783b2e0f R14: 00007f1de4bf99c0 R15: 000000000078bf0c
libceph: connect [d::]:6789 error -101
libceph: mon0 [d::]:6789 connect error
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
device lo left promiscuous mode
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
libceph: connect [d::]:6789 error -101
libceph: mon0 [d::]:6789 connect error
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
CPU: 1 PID: 19337 Comm: syz-executor.0 Not tainted 4.14.191-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/0x283 lib/dump_stack.c:58
fail_dump lib/fault-inject.c:51 [inline]
should_fail.cold+0x10a/0x154 lib/fault-inject.c:149
should_failslab+0xd6/0x130 mm/failslab.c:32
slab_pre_alloc_hook mm/slab.h:421 [inline]
slab_alloc mm/slab.c:3376 [inline]
kmem_cache_alloc+0x40/0x3c0 mm/slab.c:3550
mempool_alloc+0x10e/0x2d0 mm/mempool.c:330
bio_alloc_bioset+0x41b/0x830 block/bio.c:486
bio_alloc include/linux/bio.h:422 [inline]
submit_bh_wbc+0xf5/0x6f0 fs/buffer.c:3137
submit_bh fs/buffer.c:3169 [inline]
__bread_slow fs/buffer.c:1238 [inline]
__bread_gfp+0x11c/0x2e0 fs/buffer.c:1431
sb_bread include/linux/buffer_head.h:309 [inline]
fat12_ent_bread+0x133/0x3b0 fs/fat/fatent.c:75
fat_ent_read_block fs/fat/fatent.c:444 [inline]
fat_alloc_clusters+0x49a/0xd10 fs/fat/fatent.c:492
fat_add_cluster+0x5d/0xc0 fs/fat/inode.c:100
__fat_get_block fs/fat/inode.c:147 [inline]
fat_get_block+0x28f/0x750 fs/fat/inode.c:176
__block_write_begin_int+0x35c/0x1090 fs/buffer.c:2038
__block_write_begin fs/buffer.c:2088 [inline]
block_write_begin+0x58/0x270 fs/buffer.c:2147
cont_write_begin+0x497/0x730 fs/buffer.c:2497
fat_write_begin+0x89/0x170 fs/fat/inode.c:222
generic_perform_write+0x1c9/0x420 mm/filemap.c:3047
__generic_file_write_iter+0x227/0x590 mm/filemap.c:3172
generic_file_write_iter+0x36f/0x650 mm/filemap.c:3200
call_write_iter include/linux/fs.h:1778 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x44c/0x630 fs/read_write.c:482
vfs_write+0x17f/0x4d0 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xf2/0x210 fs/read_write.c:582
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45cc79
RSP: 002b:00007f1de4bf8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000037f80 RCX: 000000000045cc79
RDX: 00000000175d900f RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00007f1de4bf8ca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 00007ffc783b2e0f R14: 00007f1de4bf99c0 R15: 000000000078bf0c
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
libceph: connect [d::]:6789 error -101
libceph: mon0 [d::]:6789 connect error
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
FAT-fs (loop0): invalid media value (0xb8)
netlink: 12 bytes leftover after parsing attributes in process `syz-executor.4'.
FAT-fs (loop0): Can't find a valid FAT filesystem
device bond8 entered promiscuous mode
device veth23 entered promiscuous mode
bond8: Enslaving veth23 as an active interface with an up link
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
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 caif0 may have been left with an inconsistent configuration, please check.
netlink: 12 bytes leftover after parsing attributes in process `syz-executor.4'.
device veth25 entered promiscuous mode
bond8: Enslaving veth25 as an active interface with an up link
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
FAT-fs (loop0): Unrecognized mount option " " or missing value
libceph: connect [d::]:6789 error -101
libceph: mon0 [d::]:6789 connect error
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
caif:caif_disconnect_client(): nothing to disconnect
CPU: 1 PID: 19533 Comm: syz-executor.2 Not tainted 4.14.191-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/0x283 lib/dump_stack.c:58
fail_dump lib/fault-inject.c:51 [inline]
should_fail.cold+0x10a/0x154 lib/fault-inject.c:149
should_failslab+0xd6/0x130 mm/failslab.c:32
slab_pre_alloc_hook mm/slab.h:421 [inline]
slab_alloc mm/slab.c:3376 [inline]
kmem_cache_alloc_trace+0x29a/0x3d0 mm/slab.c:3616
kmalloc include/linux/slab.h:488 [inline]
kzalloc include/linux/slab.h:661 [inline]
perf_event_alloc.part.0+0x5b/0x2640 kernel/events/core.c:9551
perf_event_alloc kernel/events/core.c:10019 [inline]
SYSC_perf_event_open kernel/events/core.c:10123 [inline]
SyS_perf_event_open+0x67f/0x24b0 kernel/events/core.c:10009
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45cc79
RSP: 002b:00007f8084253c78 EFLAGS: 00000246 ORIG_RAX: 000000000000012a
RAX: ffffffffffffffda RBX: 0000000000023980 RCX: 000000000045cc79
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000002001d000
RBP: 00007f8084253ca0 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc16c059af R14: 00007f80842549c0 R15: 000000000078bf0c
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
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 caif0 may have been left with an inconsistent configuration, please check.
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
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
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
libceph: connect [d::]:6789 error -101
libceph: mon0 [d::]:6789 connect error
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
EXT4-fs (loop1): VFS: Can't find ext4 filesystem
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 caif0 may have been left with an inconsistent configuration, please check.
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
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 caif0 may have been left with an inconsistent configuration, please check.
Cannot find add_set index 1 as target


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Aug 3, 2020, 11:56:16 PM8/3/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 13af6c74 Linux 4.19.136
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13008c62900000
kernel config: https://syzkaller.appspot.com/x/.config?x=5b7578d3b5457a49
dashboard link: https://syzkaller.appspot.com/bug?extid=daad69da0f4de87f670f
compiler: gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+daad69...@syzkaller.appspotmail.com

8021q: adding VLAN 0 to HW filter on device bond2
bond0: Enslaving bond2 as an active interface with an up link
======================================================
WARNING: possible circular locking dependency detected
4.19.136-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.1/1522 is trying to acquire lock:
00000000187f9629 (&sig->cred_guard_mutex){+.+.}, at: do_io_accounting fs/proc/base.c:2738 [inline]
00000000187f9629 (&sig->cred_guard_mutex){+.+.}, at: proc_tgid_io_accounting+0x1cf/0x7f0 fs/proc/base.c:2787

but task is already holding lock:
00000000fafe693b (&p->lock){+.+.}, at: seq_read+0x6b/0x1160 fs/seq_file.c:161

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&p->lock){+.+.}:
seq_read+0x6b/0x1160 fs/seq_file.c:161
proc_reg_read+0x1bd/0x2d0 fs/proc/inode.c:231
do_loop_readv_writev fs/read_write.c:701 [inline]
do_loop_readv_writev fs/read_write.c:688 [inline]
do_iter_read+0x471/0x630 fs/read_write.c:925
vfs_readv+0xe5/0x150 fs/read_write.c:987
kernel_readv fs/splice.c:362 [inline]
default_file_splice_read+0x457/0xa00 fs/splice.c:417
do_splice_to+0x10e/0x160 fs/splice.c:881
splice_direct_to_actor+0x2b9/0x8d0 fs/splice.c:959
do_splice_direct+0x1a7/0x270 fs/splice.c:1068
do_sendfile+0x550/0xc30 fs/read_write.c:1447
__do_sys_sendfile64 fs/read_write.c:1508 [inline]
__se_sys_sendfile64+0x147/0x160 fs/read_write.c:1494
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #2 (sb_writers#3){.+.+}:
sb_start_write include/linux/fs.h:1579 [inline]
mnt_want_write+0x3a/0xb0 fs/namespace.c:360
ovl_do_remove+0xf0/0xdb0 fs/overlayfs/dir.c:843
vfs_rmdir.part.0+0x10f/0x3d0 fs/namei.c:3882
vfs_rmdir fs/namei.c:3868 [inline]
do_rmdir+0x3fd/0x490 fs/namei.c:3943
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #1 (&ovl_i_mutex_dir_key[depth]){++++}:
inode_lock_shared include/linux/fs.h:758 [inline]
do_last fs/namei.c:3326 [inline]
path_openat+0x17ec/0x2df0 fs/namei.c:3537
do_filp_open+0x18c/0x3f0 fs/namei.c:3567
do_open_execat+0x11d/0x5b0 fs/exec.c:853
__do_execve_file+0x1a8b/0x2360 fs/exec.c:1757
do_execveat_common fs/exec.c:1866 [inline]
do_execveat+0x3d/0x50 fs/exec.c:1894
__do_sys_execveat fs/exec.c:1975 [inline]
__se_sys_execveat fs/exec.c:1967 [inline]
__x64_sys_execveat+0xe1/0x120 fs/exec.c:1967
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 (&sig->cred_guard_mutex){+.+.}:
__mutex_lock_common kernel/locking/mutex.c:925 [inline]
__mutex_lock+0xd7/0x1260 kernel/locking/mutex.c:1072
do_io_accounting fs/proc/base.c:2738 [inline]
proc_tgid_io_accounting+0x1cf/0x7f0 fs/proc/base.c:2787
proc_single_show+0xeb/0x170 fs/proc/base.c:755
seq_read+0x4be/0x1160 fs/seq_file.c:229
do_loop_readv_writev fs/read_write.c:701 [inline]
do_loop_readv_writev fs/read_write.c:688 [inline]
do_iter_read+0x471/0x630 fs/read_write.c:925
vfs_readv+0xe5/0x150 fs/read_write.c:987
kernel_readv fs/splice.c:362 [inline]
default_file_splice_read+0x457/0xa00 fs/splice.c:417
do_splice_to+0x10e/0x160 fs/splice.c:881
splice_direct_to_actor+0x2b9/0x8d0 fs/splice.c:959
do_splice_direct+0x1a7/0x270 fs/splice.c:1068
do_sendfile+0x550/0xc30 fs/read_write.c:1447
__do_sys_sendfile64 fs/read_write.c:1508 [inline]
__se_sys_sendfile64+0x147/0x160 fs/read_write.c:1494
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

Chain exists of:
&sig->cred_guard_mutex --> sb_writers#3 --> &p->lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&p->lock);
lock(sb_writers#3);
lock(&p->lock);
lock(&sig->cred_guard_mutex);

*** DEADLOCK ***

1 lock held by syz-executor.1/1522:
#0: 00000000fafe693b (&p->lock){+.+.}, at: seq_read+0x6b/0x1160 fs/seq_file.c:161

stack backtrace:
CPU: 1 PID: 1522 Comm: syz-executor.1 Not tainted 4.19.136-syzkaller #0
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+0x1fc/0x2fe lib/dump_stack.c:118
print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1221
check_prev_add kernel/locking/lockdep.c:1865 [inline]
check_prevs_add kernel/locking/lockdep.c:1978 [inline]
validate_chain kernel/locking/lockdep.c:2419 [inline]
__lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3415
lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3907
__mutex_lock_common kernel/locking/mutex.c:925 [inline]
__mutex_lock+0xd7/0x1260 kernel/locking/mutex.c:1072
do_io_accounting fs/proc/base.c:2738 [inline]
proc_tgid_io_accounting+0x1cf/0x7f0 fs/proc/base.c:2787
proc_single_show+0xeb/0x170 fs/proc/base.c:755
seq_read+0x4be/0x1160 fs/seq_file.c:229
do_loop_readv_writev fs/read_write.c:701 [inline]
do_loop_readv_writev fs/read_write.c:688 [inline]
do_iter_read+0x471/0x630 fs/read_write.c:925
vfs_readv+0xe5/0x150 fs/read_write.c:987
kernel_readv fs/splice.c:362 [inline]
default_file_splice_read+0x457/0xa00 fs/splice.c:417
do_splice_to+0x10e/0x160 fs/splice.c:881
splice_direct_to_actor+0x2b9/0x8d0 fs/splice.c:959
do_splice_direct+0x1a7/0x270 fs/splice.c:1068
do_sendfile+0x550/0xc30 fs/read_write.c:1447
__do_sys_sendfile64 fs/read_write.c:1508 [inline]
__se_sys_sendfile64+0x147/0x160 fs/read_write.c:1494
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45cc79
Code: 2d b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb b5 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f051700ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000026b80 RCX: 000000000045cc79
RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004
RBP: 000000000078bf48 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000edbe R11: 0000000000000246 R12: 000000000078bf0c
R13: 00007ffce823b41f R14: 00007f051700b9c0 R15: 000000000078bf0c
netlink: 'syz-executor.5': attribute type 1 has an invalid length.
overlayfs: unrecognized mount option "upperdi���B" or missing value
overlayfs: unrecognized mount option "upperdi���B" or missing value

syzbot

unread,
May 10, 2021, 10:05:22 PM5/10/21
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 7d7d1c0a Linux 4.14.232
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17c20d95d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=17ee8a0e183900d8
dashboard link: https://syzkaller.appspot.com/bug?extid=1a6d6e76ff4c5f8008e3
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1691d7d5d00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15502965d00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+1a6d6e...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
4.14.232-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor612/7953 is trying to acquire lock:
(&sig->cred_guard_mutex){+.+.}, at: [<ffffffff81a03109>] do_io_accounting fs/proc/base.c:2725 [inline]
(&sig->cred_guard_mutex){+.+.}, at: [<ffffffff81a03109>] proc_tgid_io_accounting+0x1b9/0x7a0 fs/proc/base.c:2774

but task is already holding lock:
(&p->lock){+.+.}, at: [<ffffffff818e979a>] seq_read+0xba/0x1120 fs/seq_file.c:165

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&p->lock){+.+.}:
__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
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

-> #2 (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_create_object+0x75/0x1d0 fs/overlayfs/dir.c:538
lookup_open+0x77a/0x1750 fs/namei.c:3241
do_last fs/namei.c:3334 [inline]
path_openat+0xe08/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

-> #1 (&ovl_i_mutex_dir_key[depth]){++++}:
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

-> #0 (&sig->cred_guard_mutex){+.+.}:
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
do_io_accounting fs/proc/base.c:2725 [inline]
proc_tgid_io_accounting+0x1b9/0x7a0 fs/proc/base.c:2774
2 locks held by syz-executor612/7953:
#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
#1: (&p->lock){+.+.}, at: [<ffffffff818e979a>] seq_read+0xba/0x1120 fs/seq_file.c:165

stack backtrace:
CPU: 1 PID: 7953 Comm: syz-executor612 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
do_io_accounting fs/proc/base.c:2725 [inline]
proc_tgid_io_accounting+0x1b9/0x7a0 fs/proc/base.c:2774
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
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:0x43f239
RSP: 002b:00007fff55c1dd68 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043f239

syzbot

unread,
Feb 22, 2023, 9:05:36 PM2/22/23
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages