syzbot
WARNING: suspicious RCU usage in shmem_add_seals
Status:
fixed on 2019/12/21 01:54
Reported-by: syzbot+a10503c42dbeaa14c641@syzkaller.appspotmail.com
Fix commit:
988f701a805b
memfd: Use radix_tree_deref_slot_protected to avoid the warning.
First crash: 2491d, last: 2468d
Sample crash report:
random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1572790266.538:36): avc: denied { map } for pid=6845 comm="syz-executor220" path="/root/syz-executor220679597" dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
=============================
WARNING: suspicious RCU usage
4.14.151 #0 Not tainted
-----------------------------
./include/linux/radix-tree.h:238 suspicious rcu_dereference_check() usage!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
2 locks held by syz-executor220/6845:
#0: (&sb->s_type->i_mutex_key#12){+.+.}, at: [<ffffffff81770c7e>] inode_lock include/linux/fs.h:718 [inline]
#0: (&sb->s_type->i_mutex_key#12){+.+.}, at: [<ffffffff81770c7e>] shmem_add_seals+0x15e/0x1060 mm/shmem.c:2810
#1: (&(&mapping->tree_lock)->rlock){-...}, at: [<ffffffff81770e54>] spin_lock_irq include/linux/spinlock.h:342 [inline]
#1: (&(&mapping->tree_lock)->rlock){-...}, at: [<ffffffff81770e54>] shmem_tag_pins mm/shmem.c:2665 [inline]
#1: (&(&mapping->tree_lock)->rlock){-...}, at: [<ffffffff81770e54>] shmem_wait_for_pins mm/shmem.c:2706 [inline]
#1: (&(&mapping->tree_lock)->rlock){-...}, at: [<ffffffff81770e54>] shmem_add_seals+0x334/0x1060 mm/shmem.c:2822
stack backtrace:
CPU: 0 PID: 6845 Comm: syz-executor220 Not tainted 4.14.151 #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+0x138/0x197 lib/dump_stack.c:53
lockdep_rcu_suspicious+0x153/0x15d kernel/locking/lockdep.c:4665
radix_tree_deref_slot include/linux/radix-tree.h:238 [inline]
radix_tree_deref_slot include/linux/radix-tree.h:236 [inline]
shmem_tag_pins mm/shmem.c:2667 [inline]
shmem_wait_for_pins mm/shmem.c:2706 [inline]
shmem_add_seals+0x9e0/0x1060 mm/shmem.c:2822
shmem_fcntl+0xf7/0x130 mm/shmem.c:2857
do_fcntl+0x190/0xe10 fs/fcntl.c:421
SYSC_fcntl fs/fcntl.c:463 [inline]
SyS_fcntl+0xd5/0x110 fs/fcntl.c:448
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4401b9
RSP: 002b:00007ffeb3400b68 EFLAGS: 00000246 ORIG_RAX: 000
* Struck through repros no longer work on HEAD.