[syzbot] [v9fs?] WARNING in v9fs_init_request (2)

2 views
Skip to first unread message

syzbot

unread,
1:26 AM (17 hours ago) 1:26 AM
to asma...@codewreck.org, eri...@kernel.org, linux-...@vger.kernel.org, linu...@crudebyte.com, lu...@ionkov.net, syzkall...@googlegroups.com, v9...@lists.linux.dev
Hello,

syzbot found the following issue on:

HEAD commit: 1590cf032971 Linux 7.2-rc4
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1446a746580000
kernel config: https://syzkaller.appspot.com/x/.config?x=48ef5c5c0f192153
dashboard link: https://syzkaller.appspot.com/bug?extid=344c09c64fcd8d3d2782
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1632bc32580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13e0b789580000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-1590cf03.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/3ad7477f3064/vmlinux-1590cf03.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8e7a9174d4d6/bzImage-1590cf03.xz

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

------------[ cut here ]------------
folio expected an open fid inode->i_ino=4580113
WARNING: fs/9p/vfs_addr.c:168 at v9fs_init_request+0x451/0x540 fs/9p/vfs_addr.c:168, CPU#2: syz.0.21/5945
Modules linked in:
CPU: 2 UID: 0 PID: 5945 Comm: syz.0.21 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:v9fs_init_request+0x455/0x540 fs/9p/vfs_addr.c:168
Code: 48 b8 00 00 00 00 00 fc ff df 48 8d 7b 40 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 db 00 00 00 48 8d 3d bf b1 20 0d 48 8b 73 40 <67> 48 0f b9 3a bb ea ff ff ff e9 41 fe ff ff e8 f7 98 ff fd be 02
RSP: 0018:ffffc90003c5f778 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff888056c2d240 RCX: ffffffff840a4337
RDX: 1ffff1100ad85a50 RSI: 0000000004580113 RDI: ffffffff912af550
RBP: fffffffffffffffe R08: 0000000000000007 R09: fffffffffffff000
R10: fffffffffffffffe R11: 0000000000000000 R12: ffff888038e04178
R13: ffff888050c78e41 R14: ffff888050c78bd0 R15: ffff888056c2d240
FS: 00007ff5dd1fe6c0(0000) GS:ffff8880d5fe6000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff5dd1bbff8 CR3: 000000003d81d000 CR4: 0000000000352ef0
Call Trace:
<TASK>
netfs_alloc_request+0x71c/0xcb0 fs/netfs/objects.c:72
netfs_read_folio+0x20c/0x13f0 fs/netfs/buffered_read.c:513
filemap_read_folio+0xfc/0x3b0 mm/filemap.c:2510
do_read_cache_folio+0x2d7/0x6b0 mm/filemap.c:4140
read_mapping_folio include/linux/pagemap.h:1015 [inline]
__page_get_link.isra.0+0x30/0x350 fs/namei.c:6336
page_get_link+0x44/0xf0 fs/namei.c:6366
v9fs_vfs_get_link_dotl+0x27b/0x310 fs/9p/vfs_inode_dotl.c:930
pick_link+0xd17/0x13c0 fs/namei.c:2068
step_into_slowpath+0x9ba/0xf90 fs/namei.c:2127
step_into fs/namei.c:2152 [inline]
walk_component fs/namei.c:2288 [inline]
lookup_last fs/namei.c:2789 [inline]
path_lookupat+0x58b/0xc40 fs/namei.c:2813
filename_lookup+0x202/0x590 fs/namei.c:2842
user_path_at+0x3c/0x60 fs/namei.c:3641
do_mount fs/namespace.c:4171 [inline]
__do_sys_mount fs/namespace.c:4390 [inline]
__se_sys_mount fs/namespace.c:4367 [inline]
__x64_sys_mount+0x1fb/0x310 fs/namespace.c:4367
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff5ddb9de99
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff5dd1fe028 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ff5dde25fa0 RCX: 00007ff5ddb9de99
RDX: 00002000000004c0 RSI: 0000200000000480 RDI: 0000000000000000
RBP: 00007ff5ddc33eaf R08: 0000200000000c00 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ff5dde26038 R14: 00007ff5dde25fa0 R15: 00007ffc18202cd8
</TASK>
----------------
Code disassembly (best guess):
0: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
7: fc ff df
a: 48 8d 7b 40 lea 0x40(%rbx),%rdi
e: 48 89 fa mov %rdi,%rdx
11: 48 c1 ea 03 shr $0x3,%rdx
15: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
19: 0f 85 db 00 00 00 jne 0xfa
1f: 48 8d 3d bf b1 20 0d lea 0xd20b1bf(%rip),%rdi # 0xd20b1e5
26: 48 8b 73 40 mov 0x40(%rbx),%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb ea ff ff ff mov $0xffffffea,%ebx
34: e9 41 fe ff ff jmp 0xfffffe7a
39: e8 f7 98 ff fd call 0xfdff9935
3e: be .byte 0xbe
3f: 02 .byte 0x2


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

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
7:53 AM (10 hours ago) 7:53 AM
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: [PATCH] 9p: add DIAG WARN_ONCE sites to disambiguate v9fs_init_request no_fid failures
Author: karti...@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master


v9fs_init_request() funnels four different failure modes into a
single shared WARN_ONCE("folio expected an open fid ...") message,
making it impossible to tell from a crash report which one actually
fired. Split each site out with its own message (and the errno for
the v9fs_fid_lookup() case) to identify the exact cause of the
syzbot-reported "WARNING in v9fs_init_request (2)".

Diagnostic only, not a functional fix.

Reported-by: syzbot+344c09...@syzkaller.appspotmail.com
Signed-off-by: Deepanshu Kartikey <karti...@gmail.com>
---
fs/9p/vfs_addr.c | 37 ++++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index 1ac0b3dcc077..fc05bd963506 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -136,21 +136,37 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file)

if (file) {
fid = file->private_data;
- if (!fid)
- goto no_fid;
+ if (!fid) {
+ WARN_ONCE(1, "DIAG: v9fs_init_request: file has no fid, "
+ "inode->i_ino=%llx\n", rreq->inode->i_ino);
+ return -EINVAL;
+ }
p9_fid_get(fid);
} else if (S_ISLNK(rreq->inode->i_mode)) {
dentry = d_find_any_alias(rreq->inode);
- if (!dentry)
- goto no_fid;
+ if (!dentry) {
+ WARN_ONCE(1, "DIAG: v9fs_init_request: symlink inode has no "
+ "dentry alias, inode->i_ino=%llx\n",
+ rreq->inode->i_ino);
+ return -EINVAL;
+ }
fid = v9fs_fid_lookup(dentry);
+ if (IS_ERR(fid)) {
+ WARN_ONCE(1, "DIAG: v9fs_init_request: v9fs_fid_lookup failed "
+ "for symlink, err=%ld dentry=%pd4 inode->i_ino=%llx\n",
+ PTR_ERR(fid), dentry, rreq->inode->i_ino);
+ dput(dentry);
+ return PTR_ERR(fid);
+ }
dput(dentry);
- if (IS_ERR(fid))
- goto no_fid;
} else {
fid = v9fs_fid_find_inode(rreq->inode, writing, INVALID_UID, true);
- if (!fid)
- goto no_fid;
+ if (!fid) {
+ WARN_ONCE(1, "DIAG: v9fs_init_request: non-symlink inode has "
+ "no open/writeback fid, inode->i_ino=%llx\n",
+ rreq->inode->i_ino);
+ return -EINVAL;
+ }
}

rreq->wsize = fid->clnt->msize - P9_IOHDRSZ;
@@ -163,11 +179,6 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file)
WARN_ON(rreq->origin == NETFS_READ_FOR_WRITE && !(fid->mode & P9_ORDWR));
rreq->netfs_priv = fid;
return 0;
-
-no_fid:
- WARN_ONCE(1, "folio expected an open fid inode->i_ino=%llx\n",
- rreq->inode->i_ino);
- return -EINVAL;
}

/**
--
2.43.0

syzbot

unread,
2:20 PM (4 hours ago) 2:20 PM
to karti...@gmail.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in v9fs_init_request

DIAG: v9fs_init_request: v9fs_fid_lookup failed for symlink, err=-2 dentry=/file0 inode->i_ino=2e41f1f
WARNING: fs/9p/vfs_addr.c:155 at v9fs_init_request+0x4ac/0x690 fs/9p/vfs_addr.c:155, CPU#3: syz.0.20/6282
Modules linked in:
CPU: 3 UID: 0 PID: 6282 Comm: syz.0.20 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:v9fs_init_request+0x4b6/0x690 fs/9p/vfs_addr.c:155
Code: 00 fc ff df 48 8d 7d 40 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 c6 01 00 00 48 8d 3d 04 a1 20 0d 48 8b 4d 40 4c 89 e2 48 89 de <67> 48 0f b9 3a 4c 89 e7 e8 bd b6 8b fe e9 dc fd ff ff e8 33 83 ff
RSP: 0018:ffffc9000342f778 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: fffffffffffffffe RCX: 0000000002e41f1f
RDX: ffff88803d7a4000 RSI: fffffffffffffffe RDI: ffffffff912afa50
RBP: ffff888055ca69c0 R08: 0000000000000007 R09: fffffffffffff000
R10: fffffffffffffffe R11: 0000000000000000 R12: ffff88803d7a4000
R13: ffff88801cf86881 R14: ffff88801cf86610 R15: ffff888055ca69c0
FS: 00007f08f04826c0(0000) GS:ffff8880d60e3000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f08f0440d58 CR3: 000000003bbd0000 CR4: 0000000000352ef0
RIP: 0033:0x7f08ef59de99
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f08f0482028 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f08ef825fa0 RCX: 00007f08ef59de99
RDX: 00002000000004c0 RSI: 0000200000000480 RDI: 0000000000000000
RBP: 00007f08ef633eaf R08: 0000200000000c00 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f08ef826038 R14: 00007f08ef825fa0 R15: 00007ffdc36e11b8
</TASK>
----------------
Code disassembly (best guess):
0: 00 fc add %bh,%ah
2: ff lcall (bad)
3: df 48 8d fisttps -0x73(%rax)
6: 7d 40 jge 0x48
8: 48 89 fa mov %rdi,%rdx
b: 48 c1 ea 03 shr $0x3,%rdx
f: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
13: 0f 85 c6 01 00 00 jne 0x1df
19: 48 8d 3d 04 a1 20 0d lea 0xd20a104(%rip),%rdi # 0xd20a124
20: 48 8b 4d 40 mov 0x40(%rbp),%rcx
24: 4c 89 e2 mov %r12,%rdx
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: 4c 89 e7 mov %r12,%rdi
32: e8 bd b6 8b fe call 0xfe8bb6f4
37: e9 dc fd ff ff jmp 0xfffffe18
3c: e8 .byte 0xe8
3d: 33 .byte 0x33
3e: 83 .byte 0x83
3f: ff .byte 0xff


Tested on:

commit: 48a5a7ab Merge tag 'v7.2-rc4-smb3-client-fixes' of git..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13a3d746580000
kernel config: https://syzkaller.appspot.com/x/.config?x=d69870d5e052935f
dashboard link: https://syzkaller.appspot.com/bug?extid=344c09c64fcd8d3d2782
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
patch: https://syzkaller.appspot.com/x/patch.diff?x=17272961580000

Reply all
Reply to author
Forward
0 new messages