attempt to access beyond end of device
loop3: rw=1, want=52648, limit=40427
attempt to access beyond end of device
loop3: rw=1, want=53248, limit=40427
==================================================================
BUG: KASAN: slab-out-of-bounds in __update_iostat_latency fs/f2fs/iostat.c:190 [inline]
BUG: KASAN: slab-out-of-bounds in iostat_update_and_unbind_ctx+0xf2/0x4b0 fs/f2fs/iostat.c:227
Read of size 8 at addr ffff888111a0eda0 by task kworker/u4:67/3235
CPU: 1 PID: 3235 Comm: kworker/u4:67 Tainted: G W 5.15.98-syzkaller-00348-g7364b7abbafb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
Workqueue: writeback wb_workfn (flush-7:3)
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
print_address_description+0x87/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0x179/0x1c0 mm/kasan/report.c:444
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
__update_iostat_latency fs/f2fs/iostat.c:190 [inline]
iostat_update_and_unbind_ctx+0xf2/0x4b0 fs/f2fs/iostat.c:227
f2fs_write_end_io+0x30/0xab0 fs/f2fs/data.c:321
bio_endio+0x64a/0x670 block/bio.c:1479
submit_bio_checks+0x274/0x11e0 block/blk-core.c:908
__submit_bio+0x566/0x930 block/blk-core.c:920
__submit_bio_noacct_mq block/blk-core.c:1006 [inline]
submit_bio_noacct+0x94a/0xb20 block/blk-core.c:1036
submit_bio+0x2dd/0x560 block/blk-core.c:1098
__submit_bio+0x66c/0x9d0 fs/f2fs/data.c:518
f2fs_submit_merged_ipu_write+0x433/0x4b0 fs/f2fs/data.c:877
f2fs_write_single_data_page+0x14a9/0x1ab0 fs/f2fs/data.c:2859
f2fs_write_cache_pages fs/f2fs/data.c:3069 [inline]
__f2fs_write_data_pages fs/f2fs/data.c:3219 [inline]
f2fs_write_data_pages+0x1497/0x2bb0 fs/f2fs/data.c:3246
do_writepages+0x40e/0x670 mm/page-writeback.c:2366
__writeback_single_inode+0xdf/0xa70 fs/fs-writeback.c:1622
writeback_sb_inodes+0xb2e/0x1910 fs/fs-writeback.c:1905
wb_writeback+0x3b9/0x9e0 fs/fs-writeback.c:2079
wb_do_writeback fs/fs-writeback.c:2222 [inline]
wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2263
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2313
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2460
kthread+0x421/0x510 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 <unknown>:298
</TASK>
Allocated by task 19985:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:433 [inline]
____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512
__kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:227 [inline]
kmem_cache_alloc_trace+0x115/0x210 mm/slub.c:3265
kmalloc include/linux/slab.h:608 [inline]
kzalloc include/linux/slab.h:738 [inline]
alloc_super+0x5d/0x7d0 fs/super.c:203
sget+0x1e5/0x4c0 fs/super.c:615
mount_bdev+0xe6/0x3b0 fs/super.c:1342
f2fs_mount+0x34/0x40 fs/f2fs/super.c:4562
legacy_get_tree+0xf1/0x190 fs/fs_context.c:610
vfs_get_tree+0x88/0x290 fs/super.c:1499
do_new_mount+0x28b/0xac0 fs/namespace.c:2994
path_mount+0x671/0x1070 fs/namespace.c:3324
do_mount fs/namespace.c:3337 [inline]
__do_sys_mount fs/namespace.c:3545 [inline]
__se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3522
__x64_sys_mount+0xbf/0xd0 fs/namespace.c:3522
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
Last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
insert_work+0x56/0x320 kernel/workqueue.c:1369
__queue_work+0x923/0xcd0 kernel/workqueue.c:1535
queue_work_on+0x105/0x170 kernel/workqueue.c:1562
queue_work include/linux/workqueue.h:507 [inline]
io_ring_ctx_wait_and_kill+0x307/0x360 io_uring/io_uring.c:9751
io_uring_release+0x5b/0x70 io_uring/io_uring.c:9759
__fput+0x3fe/0x910 fs/file_table.c:280
____fput+0x15/0x20 fs/file_table.c:308
task_work_run+0x129/0x190 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0xc4/0xe0 kernel/entry/common.c:175
exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:207
__syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:300
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x61/0xcb
Second to last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
insert_work+0x56/0x320 kernel/workqueue.c:1369
__queue_work+0x923/0xcd0 kernel/workqueue.c:1535
queue_work_on+0x105/0x170 kernel/workqueue.c:1562
queue_work include/linux/workqueue.h:507 [inline]
io_ring_ctx_wait_and_kill+0x307/0x360 io_uring/io_uring.c:9751
io_uring_release+0x5b/0x70 io_uring/io_uring.c:9759
__fput+0x3fe/0x910 fs/file_table.c:280
____fput+0x15/0x20 fs/file_table.c:308
task_work_run+0x129/0x190 kernel/task_work.c:164
exit_task_work include/linux/task_work.h:32 [inline]
do_exit+0xc60/0x2b60 kernel/exit.c:875
do_group_exit+0x141/0x310 kernel/exit.c:997
get_signal+0x7a3/0x1630 kernel/signal.c:2891
arch_do_signal_or_restart+0xbd/0x1680 arch/x86/kernel/signal.c:865
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop+0xa0/0xe0 kernel/entry/common.c:172
exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:207
__syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:300
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x61/0xcb
The buggy address belongs to the object at ffff888111a0e000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1440 bytes to the right of
2048-byte region [ffff888111a0e000, ffff888111a0e800)
The buggy address belongs to the page:
page:ffffea0004468200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x111a08
head:ffffea0004468200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 0000000000000000 0000000100000001 ffff888100043200
raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 430, ts 117430279207, free_ts 117361734738
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2502
prep_new_page mm/page_alloc.c:2508 [inline]
get_page_from_freelist+0x2c14/0x2cf0 mm/page_alloc.c:4291
__alloc_pages+0x386/0x7b0 mm/page_alloc.c:5569
allocate_slab mm/slub.c:1930 [inline]
new_slab+0x92/0x490 mm/slub.c:1993
___slab_alloc+0x39e/0x830 mm/slub.c:3026
__slab_alloc+0x4a/0x90 mm/slub.c:3113
slab_alloc_node mm/slub.c:3204 [inline]
slab_alloc mm/slub.c:3246 [inline]
__kmalloc_track_caller+0x16c/0x260 mm/slub.c:4943
kmalloc_reserve net/core/skbuff.c:357 [inline]
__alloc_skb+0x10c/0x550 net/core/skbuff.c:428
alloc_skb include/linux/skbuff.h:1182 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
inet6_ifinfo_notify+0x70/0x110 net/ipv6/addrconf.c:6062
addrconf_notify+0xa8d/0xdd0 net/ipv6/addrconf.c:3680
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391
__dev_notify_flags+0x304/0x610
dev_change_flags+0xf0/0x1a0 net/core/dev.c:8864
do_setlink+0xcd1/0x3af0 net/core/rtnetlink.c:2721
__rtnl_newlink net/core/rtnetlink.c:3395 [inline]
rtnl_newlink+0x1763/0x2040 net/core/rtnetlink.c:3510
rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5587
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1370 [inline]
free_pcp_prepare mm/page_alloc.c:1442 [inline]
free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3441
free_unref_page+0xac/0x2c0 mm/page_alloc.c:3521
free_the_page mm/page_alloc.c:711 [inline]
__free_pages+0x61/0xf0 mm/page_alloc.c:5645
__free_slab+0xec/0x1d0 mm/slub.c:2018
free_slab mm/slub.c:2033 [inline]
discard_slab mm/slub.c:2039 [inline]
__unfreeze_partials+0x165/0x1a0 mm/slub.c:2525
put_cpu_partial+0xc4/0x120 mm/slub.c:2605
__slab_free+0x1c8/0x290 mm/slub.c:3386
do_slab_free mm/slub.c:3505 [inline]
___cache_free+0x109/0x120 mm/slub.c:3524
qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157
qlist_free_all+0x44/0xb0 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x15a/0x180 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:443
kasan_slab_alloc include/linux/kasan.h:217 [inline]
slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550
slab_alloc_node mm/slub.c:3238 [inline]
slab_alloc mm/slub.c:3246 [inline]
__kmalloc+0x11e/0x270 mm/slub.c:4421
__kmalloc_node include/linux/slab.h:474 [inline]
kmalloc_node include/linux/slab.h:631 [inline]
kzalloc_node include/linux/slab.h:749 [inline]
qdisc_alloc+0x75/0x770 net/sched/sch_generic.c:888
qdisc_create_dflt+0x6b/0x3e0 net/sched/sch_generic.c:950
Memory state around the buggy address:
ffff888111a0ec80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888111a0ed00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888111a0ed80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888111a0ee00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888111a0ee80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
------------[ cut here ]------------
cache_from_obj: Wrong slab cache. f2fs_bio_iostat_ctx but object is from kmalloc-4k
WARNING: CPU: 0 PID: 3235 at mm/slab.h:482 cache_from_obj mm/slab.h:480 [inline]
WARNING: CPU: 0 PID: 3235 at mm/slab.h:482 kmem_cache_free+0x241/0x2e0 mm/slub.c:3530
Modules linked in:
CPU: 0 PID: 3235 Comm: kworker/u4:67 Tainted: G B W 5.15.98-syzkaller-00348-g7364b7abbafb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
Workqueue: writeback wb_workfn (flush-7:3)
RIP: 0010:cache_from_obj mm/slab.h:480 [inline]
RIP: 0010:kmem_cache_free+0x241/0x2e0 mm/slub.c:3530
Code: ff 48 ff c8 48 89 c1 e9 53 fe ff ff 48 8b 57 60 49 8b 4f 60 48 c7 c7 f7 fe d4 85 48 89 f3 48 c7 c6 27 ff d4 85 e8 ef 04 92 ff <0f> 0b 4c 89 ff 48 89 de e8 d2 ef ff ff 48 89 de 48 81 fe 00 00 00
RSP: 0018:ffffc90006666568 EFLAGS: 00010246
RAX: 8030da708bde9d00 RBX: ffff88815ab96000 RCX: ffff88815943e2c0
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc900066665c8 R08: ffffffff815690d5 R09: ffffed103ee065e8
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffea0000000000
R13: 0000777f80000000 R14: ffff8881dab96000 R15: ffff888100043380
FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f0ba0265718 CR3: 0000000162476000 CR4: 00000000003526b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
mempool_free_slab+0x1d/0x30 mm/mempool.c:520
mempool_free+0xd7/0x310 mm/mempool.c:502
iostat_update_and_unbind_ctx+0x313/0x4b0 fs/f2fs/iostat.c:228
f2fs_write_end_io+0x30/0xab0 fs/f2fs/data.c:321
bio_endio+0x64a/0x670 block/bio.c:1479
submit_bio_checks+0x274/0x11e0 block/blk-core.c:908
__submit_bio+0x566/0x930 block/blk-core.c:920
__submit_bio_noacct_mq block/blk-core.c:1006 [inline]
submit_bio_noacct+0x94a/0xb20 block/blk-core.c:1036
submit_bio+0x2dd/0x560 block/blk-core.c:1098
__submit_bio+0x66c/0x9d0 fs/f2fs/data.c:518
f2fs_submit_merged_ipu_write+0x433/0x4b0 fs/f2fs/data.c:877
f2fs_write_single_data_page+0x14a9/0x1ab0 fs/f2fs/data.c:2859
f2fs_write_cache_pages fs/f2fs/data.c:3069 [inline]
__f2fs_write_data_pages fs/f2fs/data.c:3219 [inline]
f2fs_write_data_pages+0x1497/0x2bb0 fs/f2fs/data.c:3246
do_writepages+0x40e/0x670 mm/page-writeback.c:2366
__writeback_single_inode+0xdf/0xa70 fs/fs-writeback.c:1622
writeback_sb_inodes+0xb2e/0x1910 fs/fs-writeback.c:1905
wb_writeback+0x3b9/0x9e0 fs/fs-writeback.c:2079
wb_do_writeback fs/fs-writeback.c:2222 [inline]
wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2263
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2313
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2460
kthread+0x421/0x510 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 <unknown>:298
</TASK>
---[ end trace 8b68a2cef6a7ccac ]---
general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037]
CPU: 0 PID: 3235 Comm: kworker/u4:67 Tainted: G B W 5.15.98-syzkaller-00348-g7364b7abbafb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
Workqueue: writeback wb_workfn (flush-7:3)
RIP: 0010:NODE_MAPPING fs/f2fs/f2fs.h:2055 [inline]
RIP: 0010:f2fs_write_end_io+0x3d5/0xab0 fs/f2fs/data.c:360
Code: 00 fc ff df 80 3c 08 00 74 08 48 89 df e8 43 d0 90 ff 48 8b 1b 48 83 c3 30 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 48 89 df e8 1d d0 90 ff 4c 3b 3b 74 11 e8 63 9d
RSP: 0018:ffffc900066666b0 EFLAGS: 00010206
RAX: 0000000000000006 RBX: 0000000000000030 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88815c6b8840
RBP: ffffc90006666740 R08: dffffc0000000000 R09: ffffed102b8d7109
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff888111a0e000
R13: 0000000000000000 R14: ffffea000453f0c0 R15: ffff88815c6b8778
FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1bf81b0000 CR3: 0000000155a27000 CR4: 00000000003526b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
bio_endio+0x64a/0x670 block/bio.c:1479
submit_bio_checks+0x274/0x11e0 block/blk-core.c:908
__submit_bio+0x566/0x930 block/blk-core.c:920
__submit_bio_noacct_mq block/blk-core.c:1006 [inline]
submit_bio_noacct+0x94a/0xb20 block/blk-core.c:1036
submit_bio+0x2dd/0x560 block/blk-core.c:1098
__submit_bio+0x66c/0x9d0 fs/f2fs/data.c:518
f2fs_submit_merged_ipu_write+0x433/0x4b0 fs/f2fs/data.c:877
f2fs_write_single_data_page+0x14a9/0x1ab0 fs/f2fs/data.c:2859
f2fs_write_cache_pages fs/f2fs/data.c:3069 [inline]
__f2fs_write_data_pages fs/f2fs/data.c:3219 [inline]
f2fs_write_data_pages+0x1497/0x2bb0 fs/f2fs/data.c:3246
do_writepages+0x40e/0x670 mm/page-writeback.c:2366
__writeback_single_inode+0xdf/0xa70 fs/fs-writeback.c:1622
writeback_sb_inodes+0xb2e/0x1910 fs/fs-writeback.c:1905
wb_writeback+0x3b9/0x9e0 fs/fs-writeback.c:2079
wb_do_writeback fs/fs-writeback.c:2222 [inline]
wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2263
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2313
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2460
kthread+0x421/0x510 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 <unknown>:298
</TASK>
Modules linked in:
---[ end trace 8b68a2cef6a7ccad ]---
RIP: 0010:NODE_MAPPING fs/f2fs/f2fs.h:2055 [inline]
RIP: 0010:f2fs_write_end_io+0x3d5/0xab0 fs/f2fs/data.c:360
Code: 00 fc ff df 80 3c 08 00 74 08 48 89 df e8 43 d0 90 ff 48 8b 1b 48 83 c3 30 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 48 89 df e8 1d d0 90 ff 4c 3b 3b 74 11 e8 63 9d
RSP: 0018:ffffc900066666b0 EFLAGS: 00010206
RAX: 0000000000000006 RBX: 0000000000000030 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88815c6b8840
RBP: ffffc90006666740 R08: dffffc0000000000 R09: ffffed102b8d7109
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff888111a0e000
R13: 0000000000000000 R14: ffffea000453f0c0 R15: ffff88815c6b8778
FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2e02c000 CR3: 0000000118f6e000 CR4: 00000000003526b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 3 bytes skipped:
0: df 80 3c 08 00 74 filds 0x7400083c(%rax)
6: 08 48 89 or %cl,-0x77(%rax)
9: df e8 fucomip %st(0),%st
b: 43 d0 90 ff 48 8b 1b rex.XB rclb 0x1b8b48ff(%r8)
12: 48 83 c3 30 add $0x30,%rbx
16: 48 89 d8 mov %rbx,%rax
19: 48 c1 e8 03 shr $0x3,%rax
1d: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx
24: fc ff df
* 27: 80 3c 08 00 cmpb $0x0,(%rax,%rcx,1) <-- trapping instruction
2b: 74 08 je 0x35
2d: 48 89 df mov %rbx,%rdi
30: e8 1d d0 90 ff callq 0xff90d052
35: 4c 3b 3b cmp (%rbx),%r15
38: 74 11 je 0x4b
3a: e8 .byte 0xe8
3b: 63 .byte 0x63
3c: 9d popfq