* [syzbot] [fuse?] kernel BUG in fuse_dev_do_write
@ 2024-10-20 8:11 syzbot
2024-10-20 9:39 ` Hillf Danton
2024-10-21 1:30 ` syzbot
0 siblings, 2 replies; 5+ messages in thread
From: syzbot @ 2024-10-20 8:11 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel, miklos, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 15e7d45e786a Add linux-next specific files for 20241016
git tree: linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1597745f980000
kernel config: https://syzkaller.appspot.com/x/.config?x=c36416f1c54640c0
dashboard link: https://syzkaller.appspot.com/bug?extid=65d101735df4bb19d2a3
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1623e830580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16582f27980000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/cf2ad43c81cc/disk-15e7d45e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c85347a66a1c/vmlinux-15e7d45e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/648cf8e59c13/bzImage-15e7d45e.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+65d101735df4bb19d2a3@syzkaller.appspotmail.com
------------[ cut here ]------------
kernel BUG at include/linux/highmem.h:269!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 UID: 0 PID: 5238 Comm: syz-executor755 Not tainted 6.12.0-rc3-next-20241016-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:zero_user_segments include/linux/highmem.h:269 [inline]
RIP: 0010:folio_zero_range include/linux/highmem.h:641 [inline]
RIP: 0010:fuse_notify_store fs/fuse/dev.c:1671 [inline]
RIP: 0010:fuse_notify fs/fuse/dev.c:1908 [inline]
RIP: 0010:fuse_dev_do_write+0x5d6d/0x5da0 fs/fuse/dev.c:1992
Code: c6 a0 11 41 8c e8 43 fc c9 fe 90 0f 0b e8 ab 55 7e fe 4c 89 ef 48 c7 c6 40 11 41 8c e8 2c fc c9 fe 90 0f 0b e8 94 55 7e fe 90 <0f> 0b e8 8c 55 7e fe eb 0c e8 85 55 7e fe eb c1 e8 7e 55 7e fe 4c
RSP: 0018:ffffc90003e67860 EFLAGS: 00010293
RAX: ffffffff83168cbc RBX: 0000000000001001 RCX: ffff88802178bc00
RDX: 0000000000000000 RSI: 0000000000001001 RDI: 0000000000001000
RBP: ffffc90003e67bb0 R08: ffffffff8316685c R09: 1ffffd40003defd8
R10: dffffc0000000000 R11: fffff940003defd9 R12: 0000000000001000
R13: ffffea0001ef7ec0 R14: 1ffffd40003defd8 R15: 0000000000000001
FS: 000055557fdec380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001f80 CR3: 000000007a4ca000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
fuse_dev_write+0x148/0x1d0 fs/fuse/dev.c:2076
new_sync_write fs/read_write.c:590 [inline]
vfs_write+0xa6d/0xc90 fs/read_write.c:683
ksys_write+0x183/0x2b0 fs/read_write.c:736
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ffaa74606e9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff9501f418 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ffaa74a9029 RCX: 00007ffaa74606e9
RDX: 000000000000002a RSI: 0000000020001f80 RDI: 0000000000000003
RBP: 00007ffaa74d3610 R08: 00007fff9501f5e8 R09: 00007fff9501f5e8
R10: 0000000020000200 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fff9501f5d8 R14: 0000000000000001 R15: 0000000000000001
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:zero_user_segments include/linux/highmem.h:269 [inline]
RIP: 0010:folio_zero_range include/linux/highmem.h:641 [inline]
RIP: 0010:fuse_notify_store fs/fuse/dev.c:1671 [inline]
RIP: 0010:fuse_notify fs/fuse/dev.c:1908 [inline]
RIP: 0010:fuse_dev_do_write+0x5d6d/0x5da0 fs/fuse/dev.c:1992
Code: c6 a0 11 41 8c e8 43 fc c9 fe 90 0f 0b e8 ab 55 7e fe 4c 89 ef 48 c7 c6 40 11 41 8c e8 2c fc c9 fe 90 0f 0b e8 94 55 7e fe 90 <0f> 0b e8 8c 55 7e fe eb 0c e8 85 55 7e fe eb c1 e8 7e 55 7e fe 4c
RSP: 0018:ffffc90003e67860 EFLAGS: 00010293
RAX: ffffffff83168cbc RBX: 0000000000001001 RCX: ffff88802178bc00
RDX: 0000000000000000 RSI: 0000000000001001 RDI: 0000000000001000
RBP: ffffc90003e67bb0 R08: ffffffff8316685c R09: 1ffffd40003defd8
R10: dffffc0000000000 R11: fffff940003defd9 R12: 0000000000001000
R13: ffffea0001ef7ec0 R14: 1ffffd40003defd8 R15: 0000000000000001
FS: 000055557fdec380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055874a56a790 CR3: 000000007a4ca000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
---
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 syzkaller@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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [syzbot] [fuse?] kernel BUG in fuse_dev_do_write
2024-10-20 8:11 [syzbot] [fuse?] kernel BUG in fuse_dev_do_write syzbot
@ 2024-10-20 9:39 ` Hillf Danton
2024-10-20 10:08 ` syzbot
2024-10-21 1:30 ` syzbot
1 sibling, 1 reply; 5+ messages in thread
From: Hillf Danton @ 2024-10-20 9:39 UTC (permalink / raw)
To: syzbot; +Cc: linux-kernel, syzkaller-bugs
On Sun, 20 Oct 2024 01:11:37 -0700
> syzbot found the following issue on:
>
> HEAD commit: 15e7d45e786a Add linux-next specific files for 20241016
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16582f27980000
#syz test
--- x/fs/fuse/dev.c
+++ y/fs/fuse/dev.c
@@ -1668,7 +1668,7 @@ static int fuse_notify_store(struct fuse
err = fuse_copy_page(cs, &page, offset, this_num, 0);
if (!folio_test_uptodate(folio) && !err && offset == 0 &&
(this_num == folio_size(folio) || file_size == end)) {
- folio_zero_range(folio, this_num, folio_size(folio));
+ folio_zero_range(folio, this_num, folio_size(folio) - this_num);
folio_mark_uptodate(folio);
}
folio_unlock(folio);
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [syzbot] [fuse?] kernel BUG in fuse_dev_do_write
2024-10-20 9:39 ` Hillf Danton
@ 2024-10-20 10:08 ` syzbot
0 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2024-10-20 10:08 UTC (permalink / raw)
To: hdanton, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Reported-by: syzbot+65d101735df4bb19d2a3@syzkaller.appspotmail.com
Tested-by: syzbot+65d101735df4bb19d2a3@syzkaller.appspotmail.com
Tested on:
commit: f2493655 Add linux-next specific files for 20241018
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=12852430580000
kernel config: https://syzkaller.appspot.com/x/.config?x=838d70a59aaad5d2
dashboard link: https://syzkaller.appspot.com/bug?extid=65d101735df4bb19d2a3
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1323825f980000
Note: testing is done by a robot and is best-effort only.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [syzbot] [fuse?] kernel BUG in fuse_dev_do_write
2024-10-20 8:11 [syzbot] [fuse?] kernel BUG in fuse_dev_do_write syzbot
2024-10-20 9:39 ` Hillf Danton
@ 2024-10-21 1:30 ` syzbot
2024-10-21 3:49 ` Hou Tao
1 sibling, 1 reply; 5+ messages in thread
From: syzbot @ 2024-10-21 1:30 UTC (permalink / raw)
To: hdanton, joannelkoong, josef, linux-fsdevel, linux-kernel,
miklos, mszeredi, syzkaller-bugs
syzbot has bisected this issue to:
commit 5d9e1455630d0f464f169bbd637dbb264cbd8ac8
Author: Josef Bacik <josef@toxicpanda.com>
Date: Mon Sep 30 13:45:18 2024 +0000
fuse: convert fuse_notify_store to use folios
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=120dc25f980000
start commit: 15e7d45e786a Add linux-next specific files for 20241016
git tree: linux-next
final oops: https://syzkaller.appspot.com/x/report.txt?x=110dc25f980000
console output: https://syzkaller.appspot.com/x/log.txt?x=160dc25f980000
kernel config: https://syzkaller.appspot.com/x/.config?x=c36416f1c54640c0
dashboard link: https://syzkaller.appspot.com/bug?extid=65d101735df4bb19d2a3
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1623e830580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16582f27980000
Reported-by: syzbot+65d101735df4bb19d2a3@syzkaller.appspotmail.com
Fixes: 5d9e1455630d ("fuse: convert fuse_notify_store to use folios")
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [syzbot] [fuse?] kernel BUG in fuse_dev_do_write
2024-10-21 1:30 ` syzbot
@ 2024-10-21 3:49 ` Hou Tao
0 siblings, 0 replies; 5+ messages in thread
From: Hou Tao @ 2024-10-21 3:49 UTC (permalink / raw)
To: syzbot, joannelkoong, josef
Cc: hdanton, linux-fsdevel, linux-kernel, miklos, mszeredi, syzkaller-bugs
Hi,
On 10/21/2024 9:30 AM, syzbot wrote:
> syzbot has bisected this issue to:
>
> commit 5d9e1455630d0f464f169bbd637dbb264cbd8ac8
> Author: Josef Bacik <josef@toxicpanda.com>
> Date: Mon Sep 30 13:45:18 2024 +0000
>
> fuse: convert fuse_notify_store to use folios
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=120dc25f980000
> start commit: 15e7d45e786a Add linux-next specific files for 20241016
> git tree: linux-next
> final oops: https://syzkaller.appspot.com/x/report.txt?x=110dc25f980000
> console output: https://syzkaller.appspot.com/x/log.txt?x=160dc25f980000
> kernel config: https://syzkaller.appspot.com/x/.config?x=c36416f1c54640c0
> dashboard link: https://syzkaller.appspot.com/bug?extid=65d101735df4bb19d2a3
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1623e830580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16582f27980000
>
> Reported-by: syzbot+65d101735df4bb19d2a3@syzkaller.appspotmail.com
> Fixes: 5d9e1455630d ("fuse: convert fuse_notify_store to use folios")
>
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection
>
> .
It seems fuse_notify_store invokes folio_zero_range() incorrectly. The
third argument of folio_zero_range() should be the to-copy length
instead of the total length. The following patch will fix the problem:
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 5edad55750b0..87e39c9343c4 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1668,7 +1668,7 @@ static int fuse_notify_store(struct fuse_conn *fc,
unsigned int size,
err = fuse_copy_page(cs, &page, offset, this_num, 0);
if (!folio_test_uptodate(folio) && !err && offset == 0 &&
(this_num == folio_size(folio) || file_size == end)) {
- folio_zero_range(folio, this_num,
folio_size(folio));
+ folio_zero_range(folio, this_num,
folio_size(folio) - this_num);
folio_mark_uptodate(folio);
}
folio_unlock(folio);
Will post a formal patch later.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-21 3:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-20 8:11 [syzbot] [fuse?] kernel BUG in fuse_dev_do_write syzbot
2024-10-20 9:39 ` Hillf Danton
2024-10-20 10:08 ` syzbot
2024-10-21 1:30 ` syzbot
2024-10-21 3:49 ` Hou Tao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®