================================================================== 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+0x355/0x870 fs/f2fs/data.c:3611 Read of size 8 at addr ffff88816a7a33c8 by task syz-executor.4/10193 CPU: 1 PID: 10193 Comm: syz-executor.4 Not tainted 5.10.178-syzkaller-00127-g43c801dc3325 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __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+0x355/0x870 fs/f2fs/data.c:3611 try_to_release_page+0x188/0x1e0 mm/filemap.c:3697 shrink_page_list+0x1a25/0x4c60 mm/vmscan.c:1460 shrink_inactive_list+0x591/0x1150 mm/vmscan.c:2048 shrink_list mm/vmscan.c:2267 [inline] shrink_lruvec+0xced/0x3820 mm/vmscan.c:5435 shrink_node_memcgs mm/vmscan.c:5622 [inline] shrink_node+0xdf3/0x1fb0 mm/vmscan.c:5652 shrink_zones mm/vmscan.c:5855 [inline] do_try_to_free_pages+0x67e/0x15e0 mm/vmscan.c:5913 try_to_free_mem_cgroup_pages+0x369/0x830 mm/vmscan.c:6231 memory_high_write+0x243/0x3b0 mm/memcontrol.c:6388 cgroup_file_write+0x290/0x590 kernel/cgroup/cgroup.c:3835 kernfs_fop_write_iter+0x2c4/0x410 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:1976 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xb55/0xe70 fs/read_write.c:605 ksys_write+0x199/0x2c0 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7f9190f16169 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:00007f918fc47168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f9191036120 RCX: 00007f9190f16169 RDX: 0000000000000012 RSI: 0000000020000300 RDI: 000000000000000a RBP: 00007f9190f71ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe6b86799f R14: 00007f918fc47300 R15: 0000000000022000 Allocated by task 7872: 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:430 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:509 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x18a/0x2e0 mm/slub.c:2974 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] alloc_super+0x5d/0x780 fs/super.c:203 sget+0x1e5/0x4c0 fs/super.c:614 mount_bdev+0xe6/0x370 fs/super.c:1393 f2fs_mount+0x34/0x40 fs/f2fs/super.c:4559 legacy_get_tree+0xf1/0x190 fs/fs_context.c:592 vfs_get_tree+0x88/0x290 fs/super.c:1550 do_new_mount+0x28b/0xac0 fs/namespace.c:2899 path_mount+0x56f/0xcb0 fs/namespace.c:3229 do_mount fs/namespace.c:3242 [inline] __do_sys_mount fs/namespace.c:3450 [inline] __se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3427 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3427 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 10014: 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+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc3/0x270 mm/slub.c:4191 skb_free_head net/core/skbuff.c:605 [inline] skb_release_data+0x5c6/0x6f0 net/core/skbuff.c:625 skb_release_all net/core/skbuff.c:679 [inline] __kfree_skb net/core/skbuff.c:693 [inline] consume_skb+0xac/0x250 net/core/skbuff.c:850 netlink_broadcast_filtered+0x114e/0x1270 net/netlink/af_netlink.c:1532 netlink_broadcast net/netlink/af_netlink.c:1554 [inline] nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x101/0x1c0 net/netlink/af_netlink.c:2568 rtnl_notify net/core/rtnetlink.c:737 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3832 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3847 [inline] rtnetlink_event+0x15a/0x1b0 net/core/rtnetlink.c:5622 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_mtu+0x189/0x220 net/core/dev.c:2103 dev_set_mtu_ext+0x494/0x670 net/core/dev.c:8644 do_setlink+0x8dc/0x3c10 net/core/rtnetlink.c:2672 rtnl_group_changelink net/core/rtnetlink.c:3228 [inline] __rtnl_newlink net/core/rtnetlink.c:3384 [inline] rtnl_newlink+0x1069/0x1f10 net/core/rtnetlink.c:3494 rtnetlink_rcv_msg+0x955/0xc50 net/core/rtnetlink.c:5571 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2525 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5589 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1348 netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1944 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg net/socket.c:672 [inline] ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2357 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2411 __sys_sendmsg net/socket.c:2440 [inline] __do_sys_sendmsg net/socket.c:2449 [inline] __se_sys_sendmsg+0x1b1/0x280 net/socket.c:2447 __x64_sys_sendmsg+0x7b/0x90 net/socket.c:2447 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 insert_work+0x56/0x310 kernel/workqueue.c:1349 __queue_work+0x96c/0xd20 kernel/workqueue.c:1515 queue_work_on+0x105/0x160 kernel/workqueue.c:1542 queue_work include/linux/workqueue.h:513 [inline] schedule_work include/linux/workqueue.h:574 [inline] destroy_super_rcu+0xd1/0xe0 fs/super.c:172 rcu_do_batch+0x597/0xc40 kernel/rcu/tree.c:2492 rcu_core+0x5ad/0xe40 kernel/rcu/tree.c:2733 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2746 __do_softirq+0x268/0x5bb kernel/softirq.c:309 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 __call_rcu kernel/rcu/tree.c:2974 [inline] call_rcu+0x135/0x11f0 kernel/rcu/tree.c:3048 __put_super+0x25c/0x2b0 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:1118 __cleanup_mnt+0x19/0x20 fs/namespace.c:1125 task_work_run+0x129/0x190 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xbf/0xd0 kernel/entry/common.c:172 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xbc/0x1d0 kernel/entry/common.c:274 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xc6 The buggy address belongs to the object at ffff88816a7a3000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 968 bytes inside of 2048-byte region [ffff88816a7a3000, ffff88816a7a3800) The buggy address belongs to the page: page:ffffea0005a9e800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x16a7a0 head:ffffea0005a9e800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042d80 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 516, ts 239545028327, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2455 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2461 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4253 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5345 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] __kmalloc_track_caller+0x1f8/0x320 mm/slub.c:4536 kmemdup+0x24/0x50 mm/util.c:131 neigh_sysctl_register+0xb0/0x530 net/core/neighbour.c:3669 devinet_sysctl_register+0xaa/0x1e0 net/ipv4/devinet.c:2609 inetdev_init+0x25f/0x460 net/ipv4/devinet.c:276 inetdev_event+0x205/0x1040 net/ipv4/devinet.c:1531 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2080 register_netdevice+0x1066/0x13f0 net/core/dev.c:10055 veth_newlink+0x833/0xb70 drivers/net/veth.c:1388 page_owner free stack trace missing Memory state around the buggy address: ffff88816a7a3280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88816a7a3300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88816a7a3380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88816a7a3400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88816a7a3480: 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: 0 PID: 10193 Comm: syz-executor.4 Tainted: G B 5.10.178-syzkaller-00127-g43c801dc3325 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 RIP: 0010:f2fs_release_page+0x36f/0x870 fs/f2fs/data.c:3611 Code: ff df 80 3c 08 00 74 08 4c 89 e7 e8 4b 40 8d ff bb 28 07 00 00 49 03 1c 24 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <0f> b6 04 08 84 c0 0f 85 72 04 00 00 44 8b 23 bb 00 00 00 40 be 00 RSP: 0018:ffffc90000df6c10 EFLAGS: 00010202 RAX: 00000000000000e5 RBX: 0000000000000728 RCX: dffffc0000000000 RDX: ffffc90005744000 RSI: 0000000000000286 RDI: 00000000000208fe RBP: ffffc90000df6c48 R08: ffffffff813e1a0b R09: 0000000000000003 R10: fffffbfff0e0ea48 R11: dffffc0000000001 R12: ffff88816a7a33c8 R13: 4000000000002005 R14: 1ffffd4000b3b111 R15: ffffea00059d8880 FS: 00007f918fc47700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2bd24000 CR3: 000000010a50f000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: try_to_release_page+0x188/0x1e0 mm/filemap.c:3697 shrink_page_list+0x1a25/0x4c60 mm/vmscan.c:1460 shrink_inactive_list+0x591/0x1150 mm/vmscan.c:2048 shrink_list mm/vmscan.c:2267 [inline] shrink_lruvec+0xced/0x3820 mm/vmscan.c:5435 shrink_node_memcgs mm/vmscan.c:5622 [inline] shrink_node+0xdf3/0x1fb0 mm/vmscan.c:5652 shrink_zones mm/vmscan.c:5855 [inline] do_try_to_free_pages+0x67e/0x15e0 mm/vmscan.c:5913 try_to_free_mem_cgroup_pages+0x369/0x830 mm/vmscan.c:6231 memory_high_write+0x243/0x3b0 mm/memcontrol.c:6388 cgroup_file_write+0x290/0x590 kernel/cgroup/cgroup.c:3835 kernfs_fop_write_iter+0x2c4/0x410 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:1976 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xb55/0xe70 fs/read_write.c:605 ksys_write+0x199/0x2c0 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7f9190f16169 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:00007f918fc47168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f9191036120 RCX: 00007f9190f16169 RDX: 0000000000000012 RSI: 0000000020000300 RDI: 000000000000000a RBP: 00007f9190f71ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe6b86799f R14: 00007f918fc47300 R15: 0000000000022000 Modules linked in: ---[ end trace b861ec4f16fec432 ]--- RIP: 0010:f2fs_release_page+0x36f/0x870 fs/f2fs/data.c:3611 Code: ff df 80 3c 08 00 74 08 4c 89 e7 e8 4b 40 8d ff bb 28 07 00 00 49 03 1c 24 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <0f> b6 04 08 84 c0 0f 85 72 04 00 00 44 8b 23 bb 00 00 00 40 be 00 RSP: 0018:ffffc90000df6c10 EFLAGS: 00010202 RAX: 00000000000000e5 RBX: 0000000000000728 RCX: dffffc0000000000 RDX: ffffc90005744000 RSI: 0000000000000286 RDI: 00000000000208fe RBP: ffffc90000df6c48 R08: ffffffff813e1a0b R09: 0000000000000003 R10: fffffbfff0e0ea48 R11: dffffc0000000001 R12: ffff88816a7a33c8 R13: 4000000000002005 R14: 1ffffd4000b3b111 R15: ffffea00059d8880 FS: 00007f918fc47700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007efe4c808000 CR3: 000000010a50f000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: df 80 3c 08 00 74 filds 0x7400083c(%rax) 6: 08 4c 89 e7 or %cl,-0x19(%rcx,%rcx,4) a: e8 4b 40 8d ff callq 0xff8d405a f: bb 28 07 00 00 mov $0x728,%ebx 14: 49 03 1c 24 add (%r12),%rbx 18: 48 89 d8 mov %rbx,%rax 1b: 48 c1 e8 03 shr $0x3,%rax 1f: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx 26: fc ff df * 29: 0f b6 04 08 movzbl (%rax,%rcx,1),%eax <-- trapping instruction 2d: 84 c0 test %al,%al 2f: 0f 85 72 04 00 00 jne 0x4a7 35: 44 8b 23 mov (%rbx),%r12d 38: bb 00 00 00 40 mov $0x40000000,%ebx 3d: be .byte 0xbe