kernel BUG at fs/namei.c:LINE!

44 views
Skip to first unread message

syzbot

unread,
Jan 14, 2020, 1:33:11 AM1/14/20
to linux-...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com, vi...@zeniv.linux.org.uk
Hello,

syzbot found the following crash on:

HEAD commit: 8a28e614 Add linux-next specific files for 20200113
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=12d5fa59e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=c529c4d6ca1b2f3a
dashboard link: https://syzkaller.appspot.com/bug?extid=79eb0f3df962caf839ed
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

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

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

------------[ cut here ]------------
kernel BUG at fs/namei.c:684!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 9764 Comm: syz-executor.0 Not tainted
5.5.0-rc5-next-20200113-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:unlazy_walk+0x306/0x3b0 fs/namei.c:684
Code: ff ff ff e8 6c 3f a1 ff e8 e7 d8 b3 ff 48 c7 c6 74 6c c1 81 48 c7 c7
00 f7 ba 89 e8 e4 97 99 ff e9 d8 fe ff ff e8 ca d8 b3 ff <0f> 0b e8 c3 d8
b3 ff 0f 0b e8 bc d8 b3 ff e8 27 86 a0 ff 31 ff 89
RSP: 0018:ffffc900064cfba0 EFLAGS: 00010293
RAX: ffff88808e912040 RBX: ffffc900064cfc60 RCX: ffffffff81c16a16
RDX: 0000000000000000 RSI: ffffffff81c16ca6 RDI: 0000000000000005
RBP: ffffc900064cfbd0 R08: ffff88808e912040 R09: ffff88808e9128d8
R10: fffffbfff1549b88 R11: ffffffff8aa4dc47 R12: 0000000000000009
R13: ffffc900064cfc68 R14: ffff888096b5d9e0 R15: 0000000000000000
FS: 0000000002454940(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c0004a9000 CR3: 000000007d640000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
path_mountpoint.isra.0+0x1d5/0x340 fs/namei.c:2788
filename_mountpoint+0x181/0x380 fs/namei.c:2809
user_path_mountpoint_at+0x3a/0x50 fs/namei.c:2839
ksys_umount+0x164/0xef0 fs/namespace.c:1683
__do_sys_umount fs/namespace.c:1709 [inline]
__se_sys_umount fs/namespace.c:1707 [inline]
__x64_sys_umount+0x54/0x80 fs/namespace.c:1707
do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45d977
Code: 64 89 04 25 d0 02 00 00 58 5f ff d0 48 89 c7 e8 2f be ff ff 66 2e 0f
1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff
ff 0f 83 4d 8c fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffcf6064738 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000045d977
RDX: 0000000000403720 RSI: 0000000000000002 RDI: 00007ffcf60647e0
RBP: 0000000000000002 R08: 0000000000000000 R09: 000000000000000e
R10: 000000000000000a R11: 0000000000000206 R12: 00007ffcf6065870
R13: 0000000002455940 R14: 0000000000000000 R15: 00007ffcf6065870
Modules linked in:
---[ end trace b7d2f0f09e464864 ]---
RIP: 0010:unlazy_walk+0x306/0x3b0 fs/namei.c:684
Code: ff ff ff e8 6c 3f a1 ff e8 e7 d8 b3 ff 48 c7 c6 74 6c c1 81 48 c7 c7
00 f7 ba 89 e8 e4 97 99 ff e9 d8 fe ff ff e8 ca d8 b3 ff <0f> 0b e8 c3 d8
b3 ff 0f 0b e8 bc d8 b3 ff e8 27 86 a0 ff 31 ff 89
RSP: 0018:ffffc900064cfba0 EFLAGS: 00010293
RAX: ffff88808e912040 RBX: ffffc900064cfc60 RCX: ffffffff81c16a16
RDX: 0000000000000000 RSI: ffffffff81c16ca6 RDI: 0000000000000005
RBP: ffffc900064cfbd0 R08: ffff88808e912040 R09: ffff88808e9128d8
R10: fffffbfff1549b88 R11: ffffffff8aa4dc47 R12: 0000000000000009
R13: ffffc900064cfc68 R14: ffff888096b5d9e0 R15: 0000000000000000
FS: 0000000002454940(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd56da0a70 CR3: 000000007d640000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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.

Dan Carpenter

unread,
Jan 14, 2020, 1:59:32 AM1/14/20
to syzbot, linux-...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com, vi...@zeniv.linux.org.uk
On Mon, Jan 13, 2020 at 10:33:10PM -0800, syzbot wrote:
> ------------[ cut here ]------------
> kernel BUG at fs/namei.c:684!
> invalid opcode: 0000 [#1] PREEMPT SMP KASAN
> CPU: 1 PID: 9764 Comm: syz-executor.0 Not tainted

> 5.5.0-rc5-next-20200113-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> Google 01/01/2011

> RIP: 0010:unlazy_walk+0x306/0x3b0 fs/namei.c:684

> path_mountpoint.isra.0+0x1d5/0x340 fs/namei.c:2788
> filename_mountpoint+0x181/0x380 fs/namei.c:2809
> user_path_mountpoint_at+0x3a/0x50 fs/namei.c:2839
> ksys_umount+0x164/0xef0 fs/namespace.c:1683

2289 static const char *path_init(struct nameidata *nd, unsigned flags)
2290 {
2291 int error;
2292 const char *s = nd->name->name;
2293
2294 if (!*s)
2295 flags &= ~LOOKUP_RCU;
^^^^^^^^^^^^^^^^^^^^
My guess is that LOOKUP_RCU gets cleared out here. Maybe the problem
was introduced in commit e56b43b971a7 ("reimplement path_mountpoint()
with less magic") because before we checked LOOKUP_RCU before calling
unlazy_walk().

- /* If we're in rcuwalk, drop out of it to handle last component */
- if (nd->flags & LOOKUP_RCU) {
- if (unlazy_walk(nd))

2296 if (flags & LOOKUP_RCU)
2297 rcu_read_lock();
2298

regards,
dan carpenter

Tetsuo Handa

unread,
Jan 14, 2020, 5:04:54 AM1/14/20
to syzbot, syzkall...@googlegroups.com
commit 7a955b7363b8f62c in linux-next-20200114.

#syz fix: reimplement path_mountpoint() with less magic

Reply all
Reply to author
Forward
0 new messages