==================================================================
BUG: KASAN: use-after-free in F2FS_SB fs/f2fs/f2fs.h:1976 [inline]
BUG: KASAN: use-after-free in F2FS_I_SB fs/f2fs/f2fs.h:1981 [inline]
BUG: KASAN: use-after-free in F2FS_M_SB fs/f2fs/f2fs.h:1986 [inline]
BUG: KASAN: use-after-free in F2FS_P_SB fs/f2fs/f2fs.h:1991 [inline]
BUG: KASAN: use-after-free in f2fs_release_page+0x306/0x880 fs/f2fs/data.c:3584
Read of size 8 at addr ffff88816cd613c8 by task syz-executor.3/31268
CPU: 0 PID: 31268 Comm: syz-executor.3 Not tainted 5.15.78-syzkaller-00911-gc73b4619ad86 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
print_address_description+0x87/0x3d0 mm/kasan/report.c:256
__kasan_report mm/kasan/report.c:435 [inline]
kasan_report+0x1a6/0x1f0 mm/kasan/report.c:452
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
F2FS_SB fs/f2fs/f2fs.h:1976 [inline]
F2FS_I_SB fs/f2fs/f2fs.h:1981 [inline]
F2FS_M_SB fs/f2fs/f2fs.h:1986 [inline]
F2FS_P_SB fs/f2fs/f2fs.h:1991 [inline]
f2fs_release_page+0x306/0x880 fs/f2fs/data.c:3584
try_to_release_page+0x1b7/0x210 mm/filemap.c:4019
shrink_page_list+0x175c/0x4410 mm/vmscan.c:1741
shrink_inactive_list+0x373/0xb60 mm/vmscan.c:2310
shrink_list mm/vmscan.c:2542 [inline]
shrink_lruvec+0x4e8/0xbe0 mm/vmscan.c:5605
shrink_node_memcgs+0x43e/0xa10 mm/vmscan.c:5799
shrink_node+0x2a4/0xfa0 mm/vmscan.c:5829
shrink_zones+0x496/0x9e0 mm/vmscan.c:6032
do_try_to_free_pages+0x1d9/0xd00 mm/vmscan.c:6090
try_to_free_mem_cgroup_pages+0x39f/0x840 mm/vmscan.c:6404
try_charge_memcg+0x48a/0xf50 mm/memcontrol.c:2654
try_charge mm/memcontrol.c:2779 [inline]
charge_memcg mm/memcontrol.c:6765 [inline]
__mem_cgroup_charge+0x78/0x490 mm/memcontrol.c:6801
mem_cgroup_charge include/linux/memcontrol.h:707 [inline]
__add_to_page_cache_locked+0x2d5/0xa00 mm/filemap.c:892
add_to_page_cache_lru+0x11b/0x2c0 mm/filemap.c:984
pagecache_get_page+0xb17/0xdb0 mm/filemap.c:1951
grab_cache_page_write_begin+0x5c/0xa0 mm/filemap.c:3779
ext4_da_write_begin+0x5c1/0xbf0 fs/ext4/inode.c:3006
generic_perform_write+0x2cd/0x5d0 mm/filemap.c:3825
ext4_buffered_write_iter+0x49b/0x630 fs/ext4/file.c:271
ext4_file_write_iter+0x448/0x1cc0
__kernel_write+0x5ad/0xa60 fs/read_write.c:539
__dump_emit fs/coredump.c:875 [inline]
dump_emit+0xb43/0xd60 fs/coredump.c:912
dump_user_range+0x95/0x1d0 fs/coredump.c:949
elf_core_dump+0x3771/0x4080 fs/binfmt_elf.c:2285
do_coredump+0x13b6/0x2320 fs/coredump.c:826
get_signal+0x48c/0x1600 kernel/signal.c:2876
arch_do_signal_or_restart+0x9f/0x670 arch/x86/kernel/signal.c:865
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop+0xd4/0x110 kernel/entry/common.c:172
exit_to_user_mode_prepare+0x3b/0x40 kernel/entry/common.c:207
irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:313
irqentry_exit+0x12/0x40 kernel/entry/common.c:404
exc_general_protection+0x310/0x4a0 arch/x86/kernel/traps.c:562
asm_exc_general_protection+0x27/0x30 arch/x86/include/asm/idtentry.h:562
RIP: 0033:0x7f31d57190d1
Code: 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 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f
RSP: 002b:0000000020000140 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007f31d5839050 RCX: 00007f31d57190c9
RDX: 00000000200001c0 RSI: 0000000020000140 RDI: 000000002200a080
RBP: 00007f31d5774ae9 R08: 0000000020000280 R09: 0000000020000280
R10: 0000000020000240 R11: 0000000000000202 R12: 0000000000000000
R13: 00007ffe5947972f R14: 00007f31d446b300 R15: 0000000000022000
Allocated by task 30644:
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+0xdc/0x110 mm/kasan/common.c:512
__kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:254 [inline]
__kmalloc+0x203/0x350 mm/slub.c:4423
__kmalloc_node include/linux/slab.h:457 [inline]
kmalloc_node include/linux/slab.h:614 [inline]
kvmalloc_node+0x82/0x130 mm/util.c:623
kvmalloc include/linux/mm.h:844 [inline]
kvmalloc_array include/linux/mm.h:862 [inline]
alloc_fdtable+0xea/0x2b0 fs/file.c:136
dup_fd+0x781/0xa40 fs/file.c:354
copy_files+0xe6/0x200 kernel/fork.c:1601
copy_process+0x11e9/0x3250 kernel/fork.c:2233
kernel_clone+0x22d/0x990 kernel/fork.c:2646
__do_sys_clone kernel/fork.c:2772 [inline]
__se_sys_clone kernel/fork.c:2756 [inline]
__x64_sys_clone+0x289/0x310 kernel/fork.c:2756
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 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/0x340 kernel/workqueue.c:1369
__queue_work+0x934/0xcf0 kernel/workqueue.c:1535
queue_work_on+0xf2/0x170 kernel/workqueue.c:1562
queue_work include/linux/workqueue.h:507 [inline]
schedule_work include/linux/workqueue.h:568 [inline]
destroy_super_rcu+0xea/0x100 fs/super.c:172
rcu_do_batch+0x55b/0xbe0 kernel/rcu/tree.c:2509
rcu_core+0x506/0x1000 kernel/rcu/tree.c:2749
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2762
__do_softirq+0x27e/0x5dc 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+0x140/0x1400 kernel/rcu/tree.c:3073
__put_super+0x277/0x2e0 fs/super.c:299
put_super fs/super.c:313 [inline]
deactivate_locked_super+0xe4/0x100 fs/super.c:346
deactivate_super+0xa5/0xd0 fs/super.c:366
cleanup_mnt+0x45f/0x510 fs/namespace.c:1143
__cleanup_mnt+0x19/0x20 fs/namespace.c:1150
task_work_run+0x147/0x1b0 kernel/task_work.c:164
exit_task_work include/linux/task_work.h:32 [inline]
do_exit+0x67e/0x24d0 kernel/exit.c:828
do_group_exit+0x13a/0x300 kernel/exit.c:925
get_signal+0x77e/0x1600 kernel/signal.c:2890
arch_do_signal_or_restart+0x9f/0x670 arch/x86/kernel/signal.c:865
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop+0xd4/0x110 kernel/entry/common.c:172
exit_to_user_mode_prepare+0x3b/0x40 kernel/entry/common.c:207
irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:313
irqentry_exit+0x12/0x40 kernel/entry/common.c:404
exc_general_protection+0x310/0x4a0 arch/x86/kernel/traps.c:562
asm_exc_general_protection+0x27/0x30 arch/x86/include/asm/idtentry.h:562
The buggy address belongs to the object at ffff88816cd61000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 968 bytes inside of
2048-byte region [ffff88816cd61000, ffff88816cd61800)
The buggy address belongs to the page:
page:ffffea0005b35800 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88816cd61000 pfn:0x16cd60
head:ffffea0005b35800 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 ffffea0005b1d808 ffffea00046b2408 ffff888100043200
raw: ffff88816cd61000 0000000000080006 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 667, ts 262588172691, free_ts 0
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1ab/0x1b0 mm/page_alloc.c:2495
prep_new_page mm/page_alloc.c:2501 [inline]
get_page_from_freelist+0x38b/0x400 mm/page_alloc.c:4281
__alloc_pages+0x3a8/0x7c0 mm/page_alloc.c:5548
allocate_slab+0x62/0x580 mm/slub.c:1928
new_slab mm/slub.c:1991 [inline]
___slab_alloc+0x2e2/0x6f0 mm/slub.c:3024
__slab_alloc+0x4a/0x90 mm/slub.c:3111
slab_alloc_node mm/slub.c:3202 [inline]
slab_alloc mm/slub.c:3244 [inline]
__kmalloc_track_caller+0x25a/0x350 mm/slub.c:4941
kmemdup+0x24/0x50 mm/util.c:131
neigh_sysctl_register+0xb0/0x550 net/core/neighbour.c:3657
addrconf_sysctl_register+0xae/0x1a0 net/ipv6/addrconf.c:7125
ipv6_add_dev+0xc75/0x1120 net/ipv6/addrconf.c:455
addrconf_notify+0x584/0xec0 net/ipv6/addrconf.c:3550
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0x9e/0x110 kernel/notifier.c:391
call_netdevice_notifiers_info net/core/dev.c:2005 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2017 [inline]
call_netdevice_notifiers+0x14e/0x1d0 net/core/dev.c:2031
register_netdevice+0x13bb/0x1720 net/core/dev.c:10363
veth_newlink+0x90b/0xe60 drivers/net/veth.c:1732
page_owner free stack trace missing
Memory state around the buggy address:
ffff88816cd61280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88816cd61300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88816cd61380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88816cd61400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88816cd61480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
general protection fault, probably for non-canonical address 0xdffffc00000000cd: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000668-0x000000000000066f]
CPU: 0 PID: 31268 Comm: syz-executor.3 Tainted: G B 5.15.78-syzkaller-00911-gc73b4619ad86 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:f2fs_release_page+0x315/0x880 fs/f2fs/data.c:3584
Code: 00 00 4c 03 3b 4c 89 f8 48 c1 e8 03 42 80 3c 30 00 74 08 4c 89 ff e8 fa f4 8a ff bb 68 06 00 00 49 03 1f 48 89 d8 48 c1 e8 03 <42> 8a 04 30 84 c0 0f 85 25 05 00 00 44 8b 3b bb 00 00 00 40 be 00
RSP: 0018:ffffc90008ebd8b0 EFLAGS: 00010202
RAX: 00000000000000cd RBX: 0000000000000668 RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000282 RDI: 0000000000000001
RBP: ffffc90008ebd8f0 R08: ffffffff81430cd3 R09: fffffbfff0e4f8f5
R10: fffffbfff0e4f8f5 R11: 1ffffffff0e4f8f4 R12: ffffea00045fb880
R13: 4000000000002005 R14: dffffc0000000000 R15: ffff88816cd613c8
FS: 00007f31d446b700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc13f435000 CR3: 00000001284e1000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
try_to_release_page+0x1b7/0x210 mm/filemap.c:4019
shrink_page_list+0x175c/0x4410 mm/vmscan.c:1741
shrink_inactive_list+0x373/0xb60 mm/vmscan.c:2310
shrink_list mm/vmscan.c:2542 [inline]
shrink_lruvec+0x4e8/0xbe0 mm/vmscan.c:5605
shrink_node_memcgs+0x43e/0xa10 mm/vmscan.c:5799
shrink_node+0x2a4/0xfa0 mm/vmscan.c:5829
shrink_zones+0x496/0x9e0 mm/vmscan.c:6032
do_try_to_free_pages+0x1d9/0xd00 mm/vmscan.c:6090
try_to_free_mem_cgroup_pages+0x39f/0x840 mm/vmscan.c:6404
try_charge_memcg+0x48a/0xf50 mm/memcontrol.c:2654
try_charge mm/memcontrol.c:2779 [inline]
charge_memcg mm/memcontrol.c:6765 [inline]
__mem_cgroup_charge+0x78/0x490 mm/memcontrol.c:6801
mem_cgroup_charge include/linux/memcontrol.h:707 [inline]
__add_to_page_cache_locked+0x2d5/0xa00 mm/filemap.c:892
add_to_page_cache_lru+0x11b/0x2c0 mm/filemap.c:984
pagecache_get_page+0xb17/0xdb0 mm/filemap.c:1951
grab_cache_page_write_begin+0x5c/0xa0 mm/filemap.c:3779
ext4_da_write_begin+0x5c1/0xbf0 fs/ext4/inode.c:3006
generic_perform_write+0x2cd/0x5d0 mm/filemap.c:3825
ext4_buffered_write_iter+0x49b/0x630 fs/ext4/file.c:271
ext4_file_write_iter+0x448/0x1cc0
__kernel_write+0x5ad/0xa60 fs/read_write.c:539
__dump_emit fs/coredump.c:875 [inline]
dump_emit+0xb43/0xd60 fs/coredump.c:912
dump_user_range+0x95/0x1d0 fs/coredump.c:949
elf_core_dump+0x3771/0x4080 fs/binfmt_elf.c:2285
do_coredump+0x13b6/0x2320 fs/coredump.c:826
get_signal+0x48c/0x1600 kernel/signal.c:2876
arch_do_signal_or_restart+0x9f/0x670 arch/x86/kernel/signal.c:865
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop+0xd4/0x110 kernel/entry/common.c:172
exit_to_user_mode_prepare+0x3b/0x40 kernel/entry/common.c:207
irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:313
irqentry_exit+0x12/0x40 kernel/entry/common.c:404
exc_general_protection+0x310/0x4a0 arch/x86/kernel/traps.c:562
asm_exc_general_protection+0x27/0x30 arch/x86/include/asm/idtentry.h:562
RIP: 0033:0x7f31d57190d1
Code: 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 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f
RSP: 002b:0000000020000140 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007f31d5839050 RCX: 00007f31d57190c9
RDX: 00000000200001c0 RSI: 0000000020000140 RDI: 000000002200a080
RBP: 00007f31d5774ae9 R08: 0000000020000280 R09: 0000000020000280
R10: 0000000020000240 R11: 0000000000000202 R12: 0000000000000000
R13: 00007ffe5947972f R14: 00007f31d446b300 R15: 0000000000022000
Modules linked in:
---[ end trace b1997a0c66c7694a ]---
RIP: 0010:f2fs_release_page+0x315/0x880 fs/f2fs/data.c:3584
Code: 00 00 4c 03 3b 4c 89 f8 48 c1 e8 03 42 80 3c 30 00 74 08 4c 89 ff e8 fa f4 8a ff bb 68 06 00 00 49 03 1f 48 89 d8 48 c1 e8 03 <42> 8a 04 30 84 c0 0f 85 25 05 00 00 44 8b 3b bb 00 00 00 40 be 00
RSP: 0018:ffffc90008ebd8b0 EFLAGS: 00010202
RAX: 00000000000000cd RBX: 0000000000000668 RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000282 RDI: 0000000000000001
RBP: ffffc90008ebd8f0 R08: ffffffff81430cd3 R09: fffffbfff0e4f8f5
R10: fffffbfff0e4f8f5 R11: 1ffffffff0e4f8f4 R12: ffffea00045fb880
R13: 4000000000002005 R14: dffffc0000000000 R15: ffff88816cd613c8
FS: 00007f31d446b700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000001ffffd40 CR3: 00000001284e1000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
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 fa f4 8a ff callq 0xff8af515
1b: bb 68 06 00 00 mov $0x668,%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 8a 04 30 mov (%rax,%r14,1),%al <-- trapping instruction
2e: 84 c0 test %al,%al
30: 0f 85 25 05 00 00 jne 0x55b
36: 44 8b 3b mov (%rbx),%r15d
39: bb 00 00 00 40 mov $0x40000000,%ebx
3e: be .byte 0xbe