syz.7.5677: attempt to access beyond end of device
loop7: rw=2049, sector=45608, nr_sectors = 128 limit=40427
syz.7.5677: attempt to access beyond end of device
loop7: rw=2049, sector=45736, nr_sectors = 128 limit=40427
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 1 PID: 20643 Comm: syz.7.5677 Not tainted 6.1.115-syzkaller-00006-gc276c53965a8 #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:2940 [inline]
RIP: 0010:update_sit_entry+0x5db/0x1020 fs/f2fs/segment.c:2351
Code: 4d 98 48 8d 5c c8 18 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 e2 0e 83 ff 4c 8b 3b 4d 01 e7 4d 89 fc 49 c1 ec 03 <43> 0f b6 04 2c 84 c0 0f 85 d4 08 00 00 41 0f b6 1f 41 89 de 8b 45
RSP: 0018:ffffc9000575e448 EFLAGS: 00010203
RAX: 1ffff110260b0612 RBX: ffff888130583090 RCX: 000000000000000f
RDX: ffff888118783cc0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000575e4d0 R08: ffffffff8239e5bb R09: ffffffff8239e11e
R10: 0000000000000003 R11: ffff888118783cc0 R12: 0000000000000001
R13: dffffc0000000000 R14: ffff88811c230000 R15: 000000000000000c
FS:  00007eff1a3526c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2fe2f63320 CR3: 0000000111db7000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 f2fs_allocate_data_block+0x1558/0x3ad0 fs/f2fs/segment.c:3368
 do_write_page+0x257/0xc30 fs/f2fs/segment.c:3470
 f2fs_outplace_write_data+0x1ec/0x460 fs/f2fs/segment.c:3546
 f2fs_do_write_data_page+0xf11/0x1670 fs/f2fs/data.c:2799
 f2fs_write_single_data_page+0xb4a/0x1c70 fs/f2fs/data.c:2916
 f2fs_write_cache_pages fs/f2fs/data.c:3168 [inline]
 __f2fs_write_data_pages fs/f2fs/data.c:3318 [inline]
 f2fs_write_data_pages+0x1676/0x2af0 fs/f2fs/data.c:3345
 do_writepages+0x385/0x620 mm/page-writeback.c:2494
 filemap_fdatawrite_wbc+0x153/0x1b0 mm/filemap.c:408
 __filemap_fdatawrite_range mm/filemap.c:441 [inline]
 filemap_write_and_wait_range+0x1a4/0x290 mm/filemap.c:694
 f2fs_flush_buffered_write fs/f2fs/file.c:4705 [inline]
 f2fs_file_write_iter+0x785/0x27c0 fs/f2fs/file.c:4905
 do_iter_write+0x6e6/0xc40 fs/read_write.c:861
 vfs_iter_write+0x7c/0xa0 fs/read_write.c:902
 iter_file_splice_write+0x7f8/0xf90 fs/splice.c:685
 do_splice_from fs/splice.c:763 [inline]
 direct_splice_actor+0xff/0x130 fs/splice.c:930
 splice_direct_to_actor+0x4b4/0xbb0 fs/splice.c:885
 do_splice_direct+0x27f/0x3c0 fs/splice.c:973
 do_sendfile+0x613/0xfe0 fs/read_write.c:1255
 __do_sys_sendfile64 fs/read_write.c:1323 [inline]
 __se_sys_sendfile64 fs/read_write.c:1309 [inline]
 __x64_sys_sendfile64+0x1ce/0x230 fs/read_write.c:1309
 x64_sys_call+0x140/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:41
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7eff1957fed9
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:00007eff1a352058 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007eff19746240 RCX: 00007eff1957fed9
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 0000000000000009
RBP: 00007eff195f3cc8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000fffe80 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007eff19746240 R15: 00007ffee1a058f8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:f2fs_test_and_set_bit fs/f2fs/f2fs.h:2940 [inline]
RIP: 0010:update_sit_entry+0x5db/0x1020 fs/f2fs/segment.c:2351
Code: 4d 98 48 8d 5c c8 18 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 e2 0e 83 ff 4c 8b 3b 4d 01 e7 4d 89 fc 49 c1 ec 03 <43> 0f b6 04 2c 84 c0 0f 85 d4 08 00 00 41 0f b6 1f 41 89 de 8b 45
RSP: 0018:ffffc9000575e448 EFLAGS: 00010203
RAX: 1ffff110260b0612 RBX: ffff888130583090 RCX: 000000000000000f
RDX: ffff888118783cc0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000575e4d0 R08: ffffffff8239e5bb R09: ffffffff8239e11e
R10: 0000000000000003 R11: ffff888118783cc0 R12: 0000000000000001
R13: dffffc0000000000 R14: ffff88811c230000 R15: 000000000000000c
FS:  00007eff1a3526c0(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020010000 CR3: 0000000111db7000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	4d 98                	rex.WRB cltq
   2:	48 8d 5c c8 18       	lea    0x18(%rax,%rcx,8),%rbx
   7:	48 89 d8             	mov    %rbx,%rax
   a:	48 c1 e8 03          	shr    $0x3,%rax
   e:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
  13:	74 08                	je     0x1d
  15:	48 89 df             	mov    %rbx,%rdi
  18:	e8 e2 0e 83 ff       	call   0xff830eff
  1d:	4c 8b 3b             	mov    (%rbx),%r15
  20:	4d 01 e7             	add    %r12,%r15
  23:	4d 89 fc             	mov    %r15,%r12
  26:	49 c1 ec 03          	shr    $0x3,%r12
* 2a:	43 0f b6 04 2c       	movzbl (%r12,%r13,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 d4 08 00 00    	jne    0x90b
  37:	41 0f b6 1f          	movzbl (%r15),%ebx
  3b:	41 89 de             	mov    %ebx,%r14d
  3e:	8b                   	.byte 0x8b
  3f:	45                   	rex.RB