[v5.15] general protection fault in update_sit_entry

4 views
Skip to first unread message

syzbot

unread,
Oct 11, 2024, 1:04:29 PM10/11/24
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1225db27980000
kernel config: https://syzkaller.appspot.com/x/.config?x=4d3fd5cca89ae935
dashboard link: https://syzkaller.appspot.com/bug?extid=731f6e02febb1c3865b4
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ef5025f3d708/disk-3a592870.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/776fbdad3aa8/vmlinux-3a592870.xz
kernel image: https://storage.googleapis.com/syzbot-assets/79541db5bd16/bzImage-3a592870.xz

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

general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 4588 Comm: syz.4.377 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:f2fs_test_and_set_bit fs/f2fs/f2fs.h:2766 [inline]
RIP: 0010:update_sit_entry+0x67f/0x10d0 fs/f2fs/segment.c:2305
Code: 24 30 48 8d 5c 08 20 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 2e eb 23 fe 4c 8b 33 4d 01 ee 4c 89 f3 48 c1 eb 03 <42> 0f b6 04 3b 84 c0 4d 89 fd 0f 85 8a 08 00 00 41 0f b6 2e 41 89
RSP: 0018:ffffc900034a67c8 EFLAGS: 00010246
RAX: 1ffff1100f25ea16 RBX: 0000000000000000 RCX: 0000000000000090
RDX: ffff8880225e5940 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 000000000000007c R08: ffffffff83a637c8 R09: ffffffff83a6331a
R10: 0000000000000003 R11: ffff8880225e5940 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000000 R15: dffffc0000000000
FS: 00007f544761e6c0(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f44b52c5f98 CR3: 0000000061f35000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
f2fs_allocate_data_block+0x13dc/0x3010 fs/f2fs/segment.c:3447
do_write_page+0x172/0x6e0 fs/f2fs/segment.c:3527
f2fs_outplace_write_data+0x172/0x340 fs/f2fs/segment.c:3593
f2fs_do_write_data_page+0xd03/0x13a0 fs/f2fs/data.c:2763
f2fs_write_single_data_page+0x128a/0x1c10 fs/f2fs/data.c:2887
f2fs_write_cache_pages fs/f2fs/data.c:3138 [inline]
__f2fs_write_data_pages fs/f2fs/data.c:3288 [inline]
f2fs_write_data_pages+0x17d8/0x2bd0 fs/f2fs/data.c:3315
do_writepages+0x481/0x730 mm/page-writeback.c:2386
filemap_fdatawrite_wbc+0x1d6/0x230 mm/filemap.c:400
__filemap_fdatawrite_range mm/filemap.c:433 [inline]
filemap_write_and_wait_range+0x19e/0x280 mm/filemap.c:704
__generic_file_write_iter+0x3ae/0x4f0 mm/filemap.c:3898
f2fs_file_write_iter+0x6d4/0xb80 fs/f2fs/file.c:4374
do_iter_readv_writev+0x594/0x7a0
do_iter_write+0x1e6/0x760 fs/read_write.c:855
iter_file_splice_write+0x806/0xfa0 fs/splice.c:689
do_splice_from fs/splice.c:767 [inline]
direct_splice_actor+0xe3/0x1c0 fs/splice.c:936
splice_direct_to_actor+0x500/0xc10 fs/splice.c:891
do_splice_direct+0x285/0x3d0 fs/splice.c:979
do_sendfile+0x622/0x1000 fs/read_write.c:1249
__do_sys_sendfile64 fs/read_write.c:1317 [inline]
__se_sys_sendfile64+0x178/0x1e0 fs/read_write.c:1303
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f54491a5ff9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f544761e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f544935df80 RCX: 00007f54491a5ff9
RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000004
RBP: 00007f5449218296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000800000100001 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f544935df80 R15: 00007fffd36d9a58
</TASK>
Modules linked in:
---[ end trace 997f22a2ce96d241 ]---
RIP: 0010:f2fs_test_and_set_bit fs/f2fs/f2fs.h:2766 [inline]
RIP: 0010:update_sit_entry+0x67f/0x10d0 fs/f2fs/segment.c:2305
Code: 24 30 48 8d 5c 08 20 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 2e eb 23 fe 4c 8b 33 4d 01 ee 4c 89 f3 48 c1 eb 03 <42> 0f b6 04 3b 84 c0 4d 89 fd 0f 85 8a 08 00 00 41 0f b6 2e 41 89
RSP: 0018:ffffc900034a67c8 EFLAGS: 00010246
RAX: 1ffff1100f25ea16 RBX: 0000000000000000 RCX: 0000000000000090
RDX: ffff8880225e5940 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 000000000000007c R08: ffffffff83a637c8 R09: ffffffff83a6331a
R10: 0000000000000003 R11: ffff8880225e5940 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000000 R15: dffffc0000000000
FS: 00007f544761e6c0(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055f3e03890f8 CR3: 0000000061f35000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 24 30 and $0x30,%al
2: 48 8d 5c 08 20 lea 0x20(%rax,%rcx,1),%rbx
7: 48 89 d8 mov %rbx,%rax
a: 48 c1 e8 03 shr $0x3,%rax
e: 42 80 3c 38 00 cmpb $0x0,(%rax,%r15,1)
13: 74 08 je 0x1d
15: 48 89 df mov %rbx,%rdi
18: e8 2e eb 23 fe call 0xfe23eb4b
1d: 4c 8b 33 mov (%rbx),%r14
20: 4d 01 ee add %r13,%r14
23: 4c 89 f3 mov %r14,%rbx
26: 48 c1 eb 03 shr $0x3,%rbx
* 2a: 42 0f b6 04 3b movzbl (%rbx,%r15,1),%eax <-- trapping instruction
2f: 84 c0 test %al,%al
31: 4d 89 fd mov %r15,%r13
34: 0f 85 8a 08 00 00 jne 0x8c4
3a: 41 0f b6 2e movzbl (%r14),%ebp
3e: 41 rex.B
3f: 89 .byte 0x89


---
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 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,
Oct 12, 2024, 6:07:25 PM10/12/24
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13c81087980000
kernel config: https://syzkaller.appspot.com/x/.config?x=4d3fd5cca89ae935
dashboard link: https://syzkaller.appspot.com/bug?extid=731f6e02febb1c3865b4
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=1594fb27980000
mounted in repro: https://storage.googleapis.com/syzbot-assets/c05c9858be07/mount_2.gz

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

F2FS-fs (loop2): Mounted with checkpoint version = 48b305e6
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 1 PID: 4779 Comm: syz.2.211 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:f2fs_test_and_set_bit fs/f2fs/f2fs.h:2766 [inline]
RIP: 0010:update_sit_entry+0x67f/0x10d0 fs/f2fs/segment.c:2305
Code: 24 30 48 8d 5c 08 20 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 2e eb 23 fe 4c 8b 33 4d 01 ee 4c 89 f3 48 c1 eb 03 <42> 0f b6 04 3b 84 c0 4d 89 fd 0f 85 8a 08 00 00 41 0f b6 2e 41 89
RSP: 0018:ffffc90005cae7c8 EFLAGS: 00010246
RAX: 1ffff1100f5c9a16 RBX: 0000000000000000 RCX: 0000000000000090
RDX: ffff88801bdc9dc0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 000000000000007c R08: ffffffff83a637c8 R09: ffffffff83a6331a
R10: 0000000000000003 R11: ffff88801bdc9dc0 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000000 R15: dffffc0000000000
FS: 00007f1598f4e6c0(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001740 CR3: 000000001ebf6000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
RIP: 0033:0x7f1599ccdff9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1598f4e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f1599e85f80 RCX: 00007f1599ccdff9
RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000004
RBP: 00007f1599d40296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000800000100001 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f1599e85f80 R15: 00007ffdc0e92478
</TASK>
Modules linked in:
---[ end trace 22915284c064922e ]---
RIP: 0010:f2fs_test_and_set_bit fs/f2fs/f2fs.h:2766 [inline]
RIP: 0010:update_sit_entry+0x67f/0x10d0 fs/f2fs/segment.c:2305
Code: 24 30 48 8d 5c 08 20 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 2e eb 23 fe 4c 8b 33 4d 01 ee 4c 89 f3 48 c1 eb 03 <42> 0f b6 04 3b 84 c0 4d 89 fd 0f 85 8a 08 00 00 41 0f b6 2e 41 89
RSP: 0018:ffffc90005cae7c8 EFLAGS: 00010246
RAX: 1ffff1100f5c9a16 RBX: 0000000000000000 RCX: 0000000000000090
RDX: ffff88801bdc9dc0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 000000000000007c R08: ffffffff83a637c8 R09: ffffffff83a6331a
R10: 0000000000000003 R11: ffff88801bdc9dc0 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000000 R15: dffffc0000000000
FS: 00007f1598f4e6c0(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001740 CR3: 000000001ebf6000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 24 30 and $0x30,%al
2: 48 8d 5c 08 20 lea 0x20(%rax,%rcx,1),%rbx
7: 48 89 d8 mov %rbx,%rax
a: 48 c1 e8 03 shr $0x3,%rax
e: 42 80 3c 38 00 cmpb $0x0,(%rax,%r15,1)
13: 74 08 je 0x1d
15: 48 89 df mov %rbx,%rdi
18: e8 2e eb 23 fe call 0xfe23eb4b
1d: 4c 8b 33 mov (%rbx),%r14
20: 4d 01 ee add %r13,%r14
23: 4c 89 f3 mov %r14,%rbx
26: 48 c1 eb 03 shr $0x3,%rbx
* 2a: 42 0f b6 04 3b movzbl (%rbx,%r15,1),%eax <-- trapping instruction
2f: 84 c0 test %al,%al
31: 4d 89 fd mov %r15,%r13
34: 0f 85 8a 08 00 00 jne 0x8c4
3a: 41 0f b6 2e movzbl (%r14),%ebp
3e: 41 rex.B
3f: 89 .byte 0x89


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

syzbot

unread,
Nov 4, 2024, 7:21:31 AM11/4/24
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 72244eab0dad Linux 5.15.170
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12c0a587980000
kernel config: https://syzkaller.appspot.com/x/.config?x=d85ac7994f3a5f02
dashboard link: https://syzkaller.appspot.com/bug?extid=731f6e02febb1c3865b4
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14792d5f980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16c0a587980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/a97549f813ef/disk-72244eab.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/399cdfbc4562/vmlinux-72244eab.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a7c1fce94960/Image-72244eab.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/3cc2f3da0ce8/mount_0.gz

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

F2FS-fs (loop0): Start checkpoint disabled!
F2FS-fs (loop0): Try to recover 1th superblock, ret: 0
F2FS-fs (loop0): Mounted with checkpoint version = 48b305e6
Unable to handle kernel paging request at virtual address dfff800000000006
Mem abort info:
ESR = 0x0000000096000006
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
Data abort info:
ISV = 0, ISS = 0x00000006
CM = 0, WnR = 0
[dfff800000000006] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 4026 Comm: syz-executor373 Not tainted 5.15.170-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : f2fs_test_and_set_bit fs/f2fs/f2fs.h:2768 [inline]
pc : update_sit_entry+0x52c/0xe88 fs/f2fs/segment.c:2305
lr : f2fs_block_unit_discard fs/f2fs/f2fs.h:4395 [inline]
lr : update_sit_entry+0x3e4/0xe88 fs/f2fs/segment.c:2304
sp : ffff80001d0d7050
x29: ffff80001d0d7090 x28: 1fffe0001ac0702d x27: dfff800000000000
x26: 0000000000000000 x25: 0000000000000006 x24: 0000000000000037
x23: 0000000000000004 x22: 000000000000000a x21: ffff0000d6038168
x20: ffff0000d6038000 x19: 0000000000000000 x18: 0000000000000000
x17: 0000000000000000 x16: ffff80000a429280 x15: 00000000ffffffff
x14: ffff0000cad951c0 x13: 0000000000ff0100 x12: ffffffffffffffff
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000037
x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000000 x3 : ffff80000804605c
x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
f2fs_test_and_set_bit fs/f2fs/f2fs.h:2768 [inline]
update_sit_entry+0x52c/0xe88 fs/f2fs/segment.c:2305
f2fs_allocate_data_block+0xcb4/0x27d0 fs/f2fs/segment.c:3447
__allocate_data_block+0x4a0/0x9bc fs/f2fs/data.c:1373
f2fs_map_blocks+0x1298/0x31f8 fs/f2fs/data.c:1593
expand_inode_data+0x474/0x858 fs/f2fs/file.c:1709
f2fs_fallocate+0x350/0x898 fs/f2fs/file.c:1805
vfs_fallocate+0x478/0x5b4 fs/open.c:308
ioctl_preallocate+0x2a0/0x34c fs/ioctl.c:294
do_vfs_ioctl+0x1d00/0x2a38 fs/ioctl.c:853
__do_sys_ioctl fs/ioctl.c:872 [inline]
__se_sys_ioctl fs/ioctl.c:860 [inline]
__arm64_sys_ioctl+0xe4/0x1c8 fs/ioctl.c:860
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
Code: f9400308 f85f03a9 8b090118 d343ff19 (38fb6b28)
---[ end trace 67f06aa8c33aa623 ]---
----------------
Code disassembly (best guess):
0: f9400308 ldr x8, [x24]
4: f85f03a9 ldur x9, [x29, #-16]
8: 8b090118 add x24, x8, x9
c: d343ff19 lsr x25, x24, #3
* 10: 38fb6b28 ldrsb w8, [x25, x27] <-- trapping instruction
Reply all
Reply to author
Forward
0 new messages