possible deadlock in proc_pid_personality

5 views
Skip to first unread message

syzbot

unread,
Aug 16, 2020, 7:43:27 AM8/16/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 14b58326 Linux 4.14.193
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=125009f6900000
kernel config: https://syzkaller.appspot.com/x/.config?x=68ef0287ccbc3b42
dashboard link: https://syzkaller.appspot.com/bug?extid=6f522f64016c297f716c
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+6f522f...@syzkaller.appspotmail.com

audit: type=1400 audit(1597578148.825:2818): avc: denied { dac_override } for pid=16074 comm="syz-executor.1" capability=1 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=cap_userns permissive=1
======================================================
WARNING: possible circular locking dependency detected
4.14.193-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.1/16073 is trying to acquire lock:
(&sig->cred_guard_mutex){+.+.}, at: [<ffffffff81a6ff68>] lock_trace fs/proc/base.c:407 [inline]
(&sig->cred_guard_mutex){+.+.}, at: [<ffffffff81a6ff68>] proc_pid_personality+0x48/0x160 fs/proc/base.c:2914

but task is already holding lock:
(&p->lock){+.+.}, at: [<ffffffff8195115a>] 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
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

-> #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
lock_trace fs/proc/base.c:407 [inline]
proc_pid_personality+0x48/0x160 fs/proc/base.c:2914
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

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/16073:
#0: (&p->lock){+.+.}, at: [<ffffffff8195115a>] seq_read+0xba/0x1120 fs/seq_file.c:165

stack backtrace:
CPU: 1 PID: 16073 Comm: syz-executor.1 Not tainted 4.14.193-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
lock_trace fs/proc/base.c:407 [inline]
proc_pid_personality+0x48/0x160 fs/proc/base.c:2914
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
RIP: 0033:0x45d239
RSP: 002b:00007fe701d7bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000127
RAX: ffffffffffffffda RBX: 0000000000024ac0 RCX: 000000000045d239
RDX: 000000000000037d RSI: 0000000020000500 RDI: 0000000000000003
RBP: 000000000118cf90 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007ffc1b1548df R14: 00007fe701d7c9c0 R15: 000000000118cf4c
audit: type=1400 audit(1597578149.415:2819): avc: denied { sys_ptrace } for pid=16071 comm="syz-executor.1" capability=19 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=cap_userns permissive=1
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=106 sclass=netlink_route_socket pid=16117 comm=syz-executor.4
audit: type=1804 audit(1597578149.485:2820): pid=16103 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir567530677/syzkaller.IPQ2m1/130/bus" dev="sda1" ino=16218 res=1
sp0: Synchronizing with TNC
audit: type=1804 audit(1597578149.505:2821): pid=16103 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir567530677/syzkaller.IPQ2m1/130/bus" dev="sda1" ino=16218 res=1
audit: type=1800 audit(1597578149.505:2822): pid=16103 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="file0" dev="sda1" ino=16219 res=0
audit: type=1800 audit(1597578149.555:2823): pid=16118 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="collect_data" cause="failed" comm="syz-executor.2" name="bus" dev="sda1" ino=16224 res=0
audit: type=1804 audit(1597578149.685:2824): pid=16103 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="invalid_pcr" cause="ToMToU" comm="syz-executor.3" name="/root/syzkaller-testdir567530677/syzkaller.IPQ2m1/130/bus" dev="sda1" ino=16218 res=1
netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'.
audit: type=1804 audit(1597578149.875:2825): pid=16227 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir567530677/syzkaller.IPQ2m1/131/file0" dev="sda1" ino=16226 res=1
audit: type=1800 audit(1597578149.915:2826): pid=16227 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="file0" dev="sda1" ino=16226 res=0
audit: type=1800 audit(1597578149.935:2827): pid=16239 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="file0" dev="sda1" ino=16226 res=0
sp0: Synchronizing with TNC
dlm: plock device version mismatch: kernel (1.2.0), user (1986356271.1768060463.35)
dlm: plock device version mismatch: kernel (1.2.0), user (1986356271.1768060463.35)
sp0: Synchronizing with TNC
sp0: Synchronizing with TNC
sp0: Synchronizing with TNC
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=129 sclass=netlink_route_socket pid=16409 comm=syz-executor.2
netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'.
sp0: Synchronizing with TNC
sp0: Synchronizing with TNC
sp0: Synchronizing with TNC
sp0: Synchronizing with TNC
sp0: Synchronizing with TNC
sp0: Synchronizing with TNC
ptrace attach of "/root/syz-executor.3"[16562] was attempted by "/root/syz-executor.3"[16564]
sg_write: data in/out 940998968/1 bytes for SCSI command 0xb2-- guessing data in;
program syz-executor.3 not setting count and/or reply_len properly
PF_BRIDGE: RTM_NEWNEIGH with unknown ifindex
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'.
netlink: 20 bytes leftover after parsing attributes in process `syz-executor.1'.
netlink: 20 bytes leftover after parsing attributes in process `syz-executor.1'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'.
PF_BRIDGE: RTM_NEWNEIGH with unknown ifindex
sg_write: data in/out 940998968/1 bytes for SCSI command 0xb2-- guessing data in;
program syz-executor.3 not setting count and/or reply_len properly
sg_write: data in/out 940998968/1 bytes for SCSI command 0xb2-- guessing data in;
program syz-executor.3 not setting count and/or reply_len properly
sg_write: data in/out 940998968/1 bytes for SCSI command 0xb2-- guessing data in;
program syz-executor.3 not setting count and/or reply_len properly
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=4320 sclass=netlink_route_socket pid=16886 comm=syz-executor.4
net_ratelimit: 2 callbacks suppressed
GRED: Unable to relocate VQ 0x0 after dequeue, screwing up backlog
netlink: 36 bytes leftover after parsing attributes in process `syz-executor.0'.
sg_write: data in/out 940998968/1 bytes for SCSI command 0xb2-- guessing data in;
program syz-executor.3 not setting count and/or reply_len properly
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=4320 sclass=netlink_route_socket pid=16886 comm=syz-executor.4
sg_write: data in/out 940998968/1 bytes for SCSI command 0xb2-- guessing data in;
program syz-executor.3 not setting count and/or reply_len properly
Bluetooth: hci2 command 0x0406 tx timeout
Bluetooth: hci0 command 0x0406 tx timeout
Bluetooth: hci4 command 0x0406 tx timeout
Bluetooth: hci1 command 0x0406 tx timeout
Bluetooth: hci5 command 0x0406 tx timeout
Bluetooth: hci3 command 0x0406 tx timeout
sg_write: data in/out 940998968/1 bytes for SCSI command 0xb2-- guessing data in;
program syz-executor.3 not setting count and/or reply_len properly
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 17204 Comm: syz-executor.5 Not tainted 4.14.193-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_node mm/slab.c:3297 [inline]
kmem_cache_alloc_node_trace+0x25a/0x400 mm/slab.c:3659
__do_kmalloc_node mm/slab.c:3681 [inline]
__kmalloc_node+0x38/0x70 mm/slab.c:3689
kmalloc_node include/linux/slab.h:530 [inline]
kvmalloc_node+0x46/0xd0 mm/util.c:397
kvmalloc include/linux/mm.h:531 [inline]
kvzalloc include/linux/mm.h:539 [inline]
alloc_netdev_mqs+0x76/0xb70 net/core/dev.c:8103
sixpack_open+0xdd/0xc70 drivers/net/hamradio/6pack.c:572
tty_ldisc_open+0x6c/0xb0 drivers/tty/tty_ldisc.c:481
tty_set_ldisc+0x287/0x5d0 drivers/tty/tty_ldisc.c:606
tiocsetd drivers/tty/tty_io.c:2351 [inline]
tty_ioctl+0xa2a/0x13c0 drivers/tty/tty_io.c:2595
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:0x45d239
RSP: 002b:00007fe5b839bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000018980 RCX: 000000000045d239
RDX: 0000000020000000 RSI: 0000000000005423 RDI: 0000000000000004
RBP: 00007fe5b839bca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffe61aa943f R14: 00007fe5b839c9c0 R15: 000000000118cf4c
sg_write: data in/out 940998968/1 bytes for SCSI command 0xb2-- guessing data in;
program syz-executor.3 not setting count and/or reply_len properly
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 17226 Comm: syz-executor.5 Not tainted 4.14.193-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+0x47/0x3d0 mm/slab.c:3616
kmalloc include/linux/slab.h:488 [inline]
__hw_addr_create_ex+0x5b/0x300 net/core/dev_addr_lists.c:34
__hw_addr_add_ex+0x1c1/0x290 net/core/dev_addr_lists.c:80
__hw_addr_add net/core/dev_addr_lists.c:88 [inline]
dev_addr_init+0xfb/0x1b0 net/core/dev_addr_lists.c:371
alloc_netdev_mqs+0x11d/0xb70 net/core/dev.c:8114
sixpack_open+0xdd/0xc70 drivers/net/hamradio/6pack.c:572
tty_ldisc_open+0x6c/0xb0 drivers/tty/tty_ldisc.c:481
tty_set_ldisc+0x287/0x5d0 drivers/tty/tty_ldisc.c:606
tiocsetd drivers/tty/tty_io.c:2351 [inline]
tty_ioctl+0xa2a/0x13c0 drivers/tty/tty_io.c:2595
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:0x45d239
RSP: 002b:00007fe5b839bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000018980 RCX: 000000000045d239
RDX: 0000000020000000 RSI: 0000000000005423 RDI: 0000000000000004
RBP: 00007fe5b839bca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe61aa943f R14: 00007fe5b839c9c0 R15: 000000000118cf4c
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 17256 Comm: syz-executor.5 Not tainted 4.14.193-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_node mm/slab.c:3297 [inline]
kmem_cache_alloc_node_trace+0x25a/0x400 mm/slab.c:3659
__do_kmalloc_node mm/slab.c:3681 [inline]
__kmalloc_node+0x38/0x70 mm/slab.c:3689
kmalloc_node include/linux/slab.h:530 [inline]
kvmalloc_node+0x46/0xd0 mm/util.c:397
kvmalloc include/linux/mm.h:531 [inline]
kvzalloc include/linux/mm.h:539 [inline]
netif_alloc_netdev_queues net/core/dev.c:7525 [inline]
alloc_netdev_mqs+0x5e5/0xb70 net/core/dev.c:8146
sixpack_open+0xdd/0xc70 drivers/net/hamradio/6pack.c:572
tty_ldisc_open+0x6c/0xb0 drivers/tty/tty_ldisc.c:481
tty_set_ldisc+0x287/0x5d0 drivers/tty/tty_ldisc.c:606
tiocsetd drivers/tty/tty_io.c:2351 [inline]
tty_ioctl+0xa2a/0x13c0 drivers/tty/tty_io.c:2595
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:0x45d239
RSP: 002b:00007fe5b839bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000018980 RCX: 000000000045d239
RDX: 0000000020000000 RSI: 0000000000005423 RDI: 0000000000000004
RBP: 00007fe5b839bca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00007ffe61aa943f R14: 00007fe5b839c9c0 R15: 000000000118cf4c
sg_write: data in/out 940998968/1 bytes for SCSI command 0xb2-- guessing data in;
program syz-executor.3 not setting count and/or reply_len properly
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 17275 Comm: syz-executor.5 Not tainted 4.14.193-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_node mm/slab.c:3297 [inline]
kmem_cache_alloc_node_trace+0x25a/0x400 mm/slab.c:3659
__do_kmalloc_node mm/slab.c:3681 [inline]
__kmalloc_node+0x38/0x70 mm/slab.c:3689
kmalloc_node include/linux/slab.h:530 [inline]
kvmalloc_node+0x46/0xd0 mm/util.c:397
kvmalloc include/linux/mm.h:531 [inline]
kvzalloc include/linux/mm.h:539 [inline]
netif_alloc_rx_queues net/core/dev.c:7485 [inline]
alloc_netdev_mqs+0x75c/0xb70 net/core/dev.c:8152
sixpack_open+0xdd/0xc70 drivers/net/hamradio/6pack.c:572
overlayfs: unrecognized mount option "e1" or missing value
tty_ldisc_open+0x6c/0xb0 drivers/tty/tty_ldisc.c:481
tty_set_ldisc+0x287/0x5d0 drivers/tty/tty_ldisc.c:606
tiocsetd drivers/tty/tty_io.c:2351 [inline]
tty_ioctl+0xa2a/0x13c0 drivers/tty/tty_io.c:2595
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:0x45d239
RSP: 002b:00007fe5b839bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000018980 RCX: 000000000045d239
RDX: 0000000020000000 RSI: 0000000000005423 RDI: 0000000000000004
RBP: 00007fe5b839bca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 00007ffe61aa943f R14: 00007fe5b839c9c0 R15: 000000000118cf4c
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 17294 Comm: syz-executor.5 Not tainted 4.14.193-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]
__do_kmalloc mm/slab.c:3718 [inline]
__kmalloc+0x2c1/0x400 mm/slab.c:3729
kmalloc include/linux/slab.h:493 [inline]
sixpack_open+0x355/0xc70 drivers/net/hamradio/6pack.c:590
tty_ldisc_open+0x6c/0xb0 drivers/tty/tty_ldisc.c:481
tty_set_ldisc+0x287/0x5d0 drivers/tty/tty_ldisc.c:606
tiocsetd drivers/tty/tty_io.c:2351 [inline]
tty_ioctl+0xa2a/0x13c0 drivers/tty/tty_io.c:2595
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:0x45d239
RSP: 002b:00007fe5b839bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000018980 RCX: 000000000045d239
RDX: 0000000020000000 RSI: 0000000000005423 RDI: 0000000000000004
RBP: 00007fe5b839bca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004
R13: 00007ffe61aa943f R14: 00007fe5b839c9c0 R15: 000000000118cf4c
PF_BRIDGE: RTM_NEWNEIGH with unknown ifindex
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 17314 Comm: syz-executor.5 Not tainted 4.14.193-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]
__do_kmalloc mm/slab.c:3718 [inline]
__kmalloc+0x2c1/0x400 mm/slab.c:3729
sg_write: data in/out 940998968/1 bytes for SCSI command 0xb2-- guessing data in;
program syz-executor.3 not setting count and/or reply_len properly
kmalloc include/linux/slab.h:493 [inline]
sixpack_open+0x365/0xc70 drivers/net/hamradio/6pack.c:591
tty_ldisc_open+0x6c/0xb0 drivers/tty/tty_ldisc.c:481
tty_set_ldisc+0x287/0x5d0 drivers/tty/tty_ldisc.c:606
tiocsetd drivers/tty/tty_io.c:2351 [inline]
tty_ioctl+0xa2a/0x13c0 drivers/tty/tty_io.c:2595
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:0x45d239
RSP: 002b:00007fe5b839bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000018980 RCX: 000000000045d239


---
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 29, 2020, 9:57:22 AM8/29/20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: d7e78d08 Linux 4.14.195
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1689098e900000
kernel config: https://syzkaller.appspot.com/x/.config?x=6608b656f49b4e8c
dashboard link: https://syzkaller.appspot.com/bug?extid=6f522f64016c297f716c
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=138daf41900000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10abb561900000

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

audit: type=1400 audit(1598709280.760:8): avc: denied { execmem } for pid=6340 comm="syz-executor057" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=process permissive=1
======================================================
WARNING: possible circular locking dependency detected
4.14.195-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor057/6340 is trying to acquire lock:
(&sig->cred_guard_mutex){+.+.}, at: [<ffffffff81a707c8>] lock_trace fs/proc/base.c:407 [inline]
(&sig->cred_guard_mutex){+.+.}, at: [<ffffffff81a707c8>] proc_pid_personality+0x48/0x160 fs/proc/base.c:2914

but task is already holding lock:
(&p->lock){+.+.}, at: [<ffffffff8195132a>] seq_read+0xba/0x1120 fs/seq_file.c:165
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
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-executor057/6340:
#0: (&p->lock){+.+.}, at: [<ffffffff8195132a>] seq_read+0xba/0x1120 fs/seq_file.c:165

stack backtrace:
CPU: 0 PID: 6340 Comm: syz-executor057 Not tainted 4.14.195-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
lock_trace fs/proc/base.c:407 [inline]
proc_pid_personality+0x48/0x160 fs/proc/base.c:2914
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:0x440579
RSP: 002b:00007ffd1cac3ad8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000

Reply all
Reply to author
Forward
0 new messages