==================================================================
BUG: KASAN: use-after-free in F2FS_SB fs/f2fs/f2fs.h:1985 [inline]
BUG: KASAN: use-after-free in F2FS_I_SB fs/f2fs/f2fs.h:1990 [inline]
BUG: KASAN: use-after-free in F2FS_M_SB fs/f2fs/f2fs.h:1995 [inline]
BUG: KASAN: use-after-free in F2FS_P_SB fs/f2fs/f2fs.h:2000 [inline]
BUG: KASAN: use-after-free in f2fs_release_page+0x2fa/0x890 fs/f2fs/data.c:3600
Read of size 8 at addr ffff88810a6983c8 by task syz-executor.3/28585
CPU: 1 PID: 28585 Comm: syz-executor.3 Not tainted 5.15.106-syzkaller-00249-g19c0ed55a470 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
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
F2FS_SB fs/f2fs/f2fs.h:1985 [inline]
F2FS_I_SB fs/f2fs/f2fs.h:1990 [inline]
F2FS_M_SB fs/f2fs/f2fs.h:1995 [inline]
F2FS_P_SB fs/f2fs/f2fs.h:2000 [inline]
f2fs_release_page+0x2fa/0x890 fs/f2fs/data.c:3600
try_to_release_page+0x194/0x1f0 mm/filemap.c:4025
shrink_page_list+0x1f22/0x5820 mm/vmscan.c:1754
shrink_inactive_list mm/vmscan.c:2261 [inline]
shrink_list mm/vmscan.c:2506 [inline]
shrink_lruvec+0x17e9/0x4340 mm/vmscan.c:5694
shrink_node_memcgs mm/vmscan.c:5886 [inline]
shrink_node+0x1077/0x24e0 mm/vmscan.c:5916
shrink_zones mm/vmscan.c:6119 [inline]
do_try_to_free_pages+0x5b6/0x1570 mm/vmscan.c:6177
try_to_free_mem_cgroup_pages+0x36c/0x850 mm/vmscan.c:6491
memory_high_write+0x243/0x3b0 mm/memcontrol.c:6382
cgroup_file_write+0x290/0x590 kernel/cgroup/cgroup.c:3943
kernfs_fop_write_iter+0x2c4/0x410 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2159 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xd8a/0x1160 fs/read_write.c:594
ksys_write+0x199/0x2c0 fs/read_write.c:647
__do_sys_write fs/read_write.c:659 [inline]
__se_sys_write fs/read_write.c:656 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:656
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
RIP: 0033:0x7fc79e5a4169
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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:00007fc79d2d5168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc79e6c4120 RCX: 00007fc79e5a4169
RDX: 0000000000000012 RSI: 0000000020000300 RDI: 000000000000000a
RBP: 00007fc79e5ffca1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff4f4749af R14: 00007fc79d2d5300 R15: 0000000000022000
</TASK>
Allocated by task 638:
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]
__kmalloc+0x13a/0x270 mm/slub.c:4425
__kmalloc_node include/linux/slab.h:474 [inline]
kmalloc_node include/linux/slab.h:631 [inline]
kvmalloc_node+0x82/0x130 mm/util.c:623
kvmalloc include/linux/mm.h:851 [inline]
kvmalloc_array include/linux/mm.h:869 [inline]
alloc_fdtable+0xeb/0x2a0 fs/file.c:136
dup_fd+0x759/0xb00 fs/file.c:354
copy_files+0xe6/0x200 kernel/fork.c:1612
copy_process+0x11f3/0x3260 kernel/fork.c:2244
kernel_clone+0x21e/0x9e0 kernel/fork.c:2659
__do_sys_clone kernel/fork.c:2785 [inline]
__se_sys_clone kernel/fork.c:2769 [inline]
__x64_sys_clone+0x23f/0x290 kernel/fork.c:2769
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
Freed by task 28230:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
kasan_slab_free include/linux/kasan.h:193 [inline]
slab_free_hook mm/slub.c:1723 [inline]
slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749
slab_free mm/slub.c:3517 [inline]
kfree+0xc8/0x220 mm/slub.c:4577
kvfree+0x35/0x40 mm/util.c:658
__free_fdtable fs/file.c:36 [inline]
put_files_struct+0x284/0x320 fs/file.c:451
exit_files+0x80/0xa0 fs/file.c:464
do_exit+0xc29/0x2b60 kernel/exit.c:870
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:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
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]
schedule_work include/linux/workqueue.h:568 [inline]
destroy_super_rcu+0xd1/0xe0 fs/super.c:172
rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2509
rcu_core+0x517/0x1020 kernel/rcu/tree.c:2749
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2762
__do_softirq+0x26d/0x5bf kernel/softirq.c:565
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
__call_rcu kernel/rcu/tree.c:2993 [inline]
call_rcu+0x133/0x12a0 kernel/rcu/tree.c:3073
__put_super+0x26d/0x2e0 fs/super.c:299
put_super fs/super.c:313 [inline]
deactivate_locked_super+0xe1/0x110 fs/super.c:346
deactivate_super+0xbe/0xf0 fs/super.c:366
cleanup_mnt+0x45c/0x510 fs/namespace.c:1143
__cleanup_mnt+0x19/0x20 fs/namespace.c:1150
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:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301
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 ffff88810a698000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 968 bytes inside of
2048-byte region [ffff88810a698000, ffff88810a698800)
The buggy address belongs to the page:
page:ffffea000429a600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10a698
head:ffffea000429a600 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 ffffea00059cc800 0000000300000003 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4470, ts 475843048567, free_ts 475841267270
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+0x16d/0x270 mm/slub.c:4421
kmalloc_array include/linux/slab.h:648 [inline]
kcalloc include/linux/slab.h:677 [inline]
veth_alloc_queues drivers/net/veth.c:1321 [inline]
veth_dev_init+0x1aa/0x350 drivers/net/veth.c:1348
register_netdevice+0x343/0x1350 net/core/dev.c:10264
veth_newlink+0x720/0xe30 drivers/net/veth.c:1702
__rtnl_newlink net/core/rtnetlink.c:3462 [inline]
rtnl_newlink+0x146e/0x2040 net/core/rtnetlink.c:3510
rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5587
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2533
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5605
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1356
netlink_sendmsg+0xa0a/0xd20 net/netlink/af_netlink.c:1952
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]
kmem_cache_alloc+0xf5/0x200 mm/slub.c:3251
kmem_cache_alloc_node include/linux/slab.h:479 [inline]
__alloc_skb+0xbe/0x550 net/core/skbuff.c:416
alloc_skb include/linux/skbuff.h:1182 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
netlink_ack+0x33c/0xb10 net/netlink/af_netlink.c:2468
Memory state around the buggy address:
ffff88810a698280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88810a698300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88810a698380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88810a698400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88810a698480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
general protection fault, probably for non-canonical address 0xdffffc00000000e5: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000728-0x000000000000072f]
CPU: 1 PID: 28585 Comm: syz-executor.3 Tainted: G B 5.15.106-syzkaller-00249-g19c0ed55a470 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
RIP: 0010:f2fs_release_page+0x309/0x890 fs/f2fs/data.c:3600
Code: 00 00 4c 03 3b 4c 89 f8 48 c1 e8 03 42 80 3c 30 00 74 08 4c 89 ff e8 06 af 8b ff bb 28 07 00 00 49 03 1f 48 89 d8 48 c1 e8 03 <42> 0f b6 04 30 84 c0 0f 85 3f 05 00 00 44 8b 3b bb 00 00 00 40 be
RSP: 0018:ffffc900096c6c40 EFLAGS: 00010202
RAX: 00000000000000e5 RBX: 0000000000000728 RCX: 0000000000040000
RDX: ffffc90004c66000 RSI: 0000000000000282 RDI: 0000000000035f09
RBP: ffffc900096c6c88 R08: ffffffff8141671b R09: 0000000000000003
R10: fffffbfff0e4f84c R11: dffffc0000000001 R12: ffffea0004a8c800
R13: 4000000000002005 R14: dffffc0000000000 R15: ffff88810a6983c8
FS: 00007fc79d2d5700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc79d2d5718 CR3: 000000010dfd0000 CR4: 00000000003506a0
Call Trace:
<TASK>
try_to_release_page+0x194/0x1f0 mm/filemap.c:4025
shrink_page_list+0x1f22/0x5820 mm/vmscan.c:1754
shrink_inactive_list mm/vmscan.c:2261 [inline]
shrink_list mm/vmscan.c:2506 [inline]
shrink_lruvec+0x17e9/0x4340 mm/vmscan.c:5694
shrink_node_memcgs mm/vmscan.c:5886 [inline]
shrink_node+0x1077/0x24e0 mm/vmscan.c:5916
shrink_zones mm/vmscan.c:6119 [inline]
do_try_to_free_pages+0x5b6/0x1570 mm/vmscan.c:6177
try_to_free_mem_cgroup_pages+0x36c/0x850 mm/vmscan.c:6491
memory_high_write+0x243/0x3b0 mm/memcontrol.c:6382
cgroup_file_write+0x290/0x590 kernel/cgroup/cgroup.c:3943
kernfs_fop_write_iter+0x2c4/0x410 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2159 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xd8a/0x1160 fs/read_write.c:594
ksys_write+0x199/0x2c0 fs/read_write.c:647
__do_sys_write fs/read_write.c:659 [inline]
__se_sys_write fs/read_write.c:656 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:656
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
RIP: 0033:0x7fc79e5a4169
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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:00007fc79d2d5168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc79e6c4120 RCX: 00007fc79e5a4169
RDX: 0000000000000012 RSI: 0000000020000300 RDI: 000000000000000a
RBP: 00007fc79e5ffca1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff4f4749af R14: 00007fc79d2d5300 R15: 0000000000022000
</TASK>
Modules linked in:
---[ end trace e1cb94cd79a817f7 ]---
RIP: 0010:f2fs_release_page+0x309/0x890 fs/f2fs/data.c:3600
Code: 00 00 4c 03 3b 4c 89 f8 48 c1 e8 03 42 80 3c 30 00 74 08 4c 89 ff e8 06 af 8b ff bb 28 07 00 00 49 03 1f 48 89 d8 48 c1 e8 03 <42> 0f b6 04 30 84 c0 0f 85 3f 05 00 00 44 8b 3b bb 00 00 00 40 be
RSP: 0018:ffffc900096c6c40 EFLAGS: 00010202
RAX: 00000000000000e5 RBX: 0000000000000728 RCX: 0000000000040000
RDX: ffffc90004c66000 RSI: 0000000000000282 RDI: 0000000000035f09
RBP: ffffc900096c6c88 R08: ffffffff8141671b R09: 0000000000000003
R10: fffffbfff0e4f84c R11: dffffc0000000001 R12: ffffea0004a8c800
R13: 4000000000002005 R14: dffffc0000000000 R15: ffff88810a6983c8
FS: 00007fc79d2d5700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b33127000 CR3: 000000010dfd0000 CR4: 00000000003506a0
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: 4c 03 3b add (%rbx),%r15
5: 4c 89 f8 mov %r15,%rax
8: 48 c1 e8 03 shr $0x3,%rax
c: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1)
11: 74 08 je 0x1b
13: 4c 89 ff mov %r15,%rdi
16: e8 06 af 8b ff callq 0xff8baf21
1b: bb 28 07 00 00 mov $0x728,%ebx
20: 49 03 1f add (%r15),%rbx
23: 48 89 d8 mov %rbx,%rax
26: 48 c1 e8 03 shr $0x3,%rax
* 2a: 42 0f b6 04 30 movzbl (%rax,%r14,1),%eax <-- trapping instruction
2f: 84 c0 test %al,%al
31: 0f 85 3f 05 00 00 jne 0x576
37: 44 8b 3b mov (%rbx),%r15d
3a: bb 00 00 00 40 mov $0x40000000,%ebx
3f: be .byte 0xbe