WARNING: suspicious RCU usage in shmem_add_seals

8 views
Skip to first unread message

syzbot

unread,
Oct 29, 2019, 5:48:08 AM10/29/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: ddef1e8e Linux 4.14.151
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1031d61f600000
kernel config: https://syzkaller.appspot.com/x/.config?x=a2b317f0c5f02ed3
dashboard link: https://syzkaller.appspot.com/bug?extid=a10503c42dbeaa14c641
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16d6530f600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1733bde4e00000

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

random: sshd: uninitialized urandom read (32 bytes read)
urandom_read: 1 callbacks suppressed
random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1572342208.996:36): avc: denied { map } for
pid=6973 comm="syz-executor374" path="/root/syz-executor374194069"
dev="sda1" ino=16484 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-executor374/6973:
#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: 6973 Comm: syz-executor374 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:0x440189
RS


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Nov 27, 2019, 3:21:02 AM11/27/19
to syzkaller...@googlegroups.com
syzbot has bisected this bug to:

commit 391d4ee568b546c9900cc058b82d290e2f71a99c
Author: Matthew Wilcox (Oracle) <wi...@infradead.org>
Date: Fri Oct 25 16:58:35 2019 +0000

memfd: Fix locking when tagging pins

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1419f8bce00000
start commit: ddef1e8e Linux 4.14.151
git tree: linux-4.14.y
final crash: https://syzkaller.appspot.com/x/report.txt?x=1619f8bce00000
console output: https://syzkaller.appspot.com/x/log.txt?x=1219f8bce00000
Reported-by: syzbot+a10503...@syzkaller.appspotmail.com
Fixes: 391d4ee568b5 ("memfd: Fix locking when tagging pins")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Dec 20, 2019, 8:51:02 PM12/20/19
to syzkaller...@googlegroups.com
syzbot suspects this bug was fixed by commit:

commit 988f701a805bf980e70a557894d26564e10fc1a6
Author: zhong jiang <zhong...@huawei.com>
Date: Mon Nov 18 03:26:07 2019 +0000

memfd: Use radix_tree_deref_slot_protected to avoid the warning.

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11c7fbb6e00000
start commit: ddef1e8e Linux 4.14.151
git tree: linux-4.14.y
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13505268e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=136141a4e00000

If the result looks correct, please mark the bug fixed by replying with:

#syz fix: memfd: Use radix_tree_deref_slot_protected to avoid the warning.
Reply all
Reply to author
Forward
0 new messages