loop0: detected capacity change from 0 to 2048 ================================================================== BUG: KASAN: use-after-free in nilfs_mdt_destroy+0x6f/0x80 fs/nilfs2/mdt.c:497 Read of size 8 at addr ffff888020c53098 by task syz-executor325/3731 CPU: 1 PID: 3731 Comm: syz-executor325 Not tainted 6.0.0-rc7-syzkaller-00042-g46452d3786a8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 nilfs_mdt_destroy+0x6f/0x80 fs/nilfs2/mdt.c:497 nilfs_free_inode+0x3e/0x60 fs/nilfs2/super.c:168 i_callback fs/inode.c:249 [inline] alloc_inode+0x13b/0x230 fs/inode.c:274 new_inode_pseudo fs/inode.c:1019 [inline] new_inode+0x27/0x270 fs/inode.c:1047 nilfs_new_inode+0xca/0x830 fs/nilfs2/inode.c:334 nilfs_create fs/nilfs2/namei.c:85 [inline] nilfs_create+0xfe/0x300 fs/nilfs2/namei.c:75 lookup_open.isra.0+0xf05/0x12a0 fs/namei.c:3413 open_last_lookups fs/namei.c:3481 [inline] path_openat+0x996/0x28f0 fs/namei.c:3688 do_filp_open+0x1b6/0x400 fs/namei.c:3718 do_sys_openat2+0x16d/0x4c0 fs/open.c:1313 do_sys_open fs/open.c:1329 [inline] __do_sys_openat fs/open.c:1345 [inline] __se_sys_openat fs/open.c:1340 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1340 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f7126c14b69 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffcf5231628 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f7126c14b69 RDX: 000000000000275a RSI: 0000000020000040 RDI: 00000000ffffff9c RBP: 00007ffcf5231650 R08: 0000000000000002 R09: 00007ffcf5231660 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003 R13: 00007ffcf5231690 R14: 00007ffcf5231670 R15: 000000000000003b Allocated by task 22: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmalloc_reserve net/core/skbuff.c:362 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:434 __napi_alloc_skb+0x93/0x340 net/core/skbuff.c:575 napi_alloc_skb include/linux/skbuff.h:3207 [inline] page_to_skb+0x17d/0xc10 drivers/net/virtio_net.c:496 receive_mergeable drivers/net/virtio_net.c:1119 [inline] receive_buf+0xe0a/0x5560 drivers/net/virtio_net.c:1258 virtnet_receive drivers/net/virtio_net.c:1553 [inline] virtnet_poll+0x708/0x1310 drivers/net/virtio_net.c:1671 __napi_poll+0xb3/0x6d0 net/core/dev.c:6511 napi_poll net/core/dev.c:6578 [inline] net_rx_action+0x9c1/0xd90 net/core/dev.c:6689 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 Freed by task 22: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kfree+0xe2/0x580 mm/slub.c:4567 skb_free_head+0xac/0x110 net/core/skbuff.c:662 skb_release_data+0x5f1/0x870 net/core/skbuff.c:691 skb_release_all net/core/skbuff.c:756 [inline] __kfree_skb+0x46/0x60 net/core/skbuff.c:770 tcp_rcv_established+0x1477/0x20e0 net/ipv4/tcp_input.c:5914 tcp_v4_do_rcv+0x66c/0x9b0 net/ipv4/tcp_ipv4.c:1661 tcp_v4_rcv+0x3438/0x3930 net/ipv4/tcp_ipv4.c:2078 ip_protocol_deliver_rcu+0x9b/0x7c0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2e8/0x4c0 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip_local_deliver+0x1aa/0x200 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:461 [inline] ip_sublist_rcv_finish+0x9a/0x2c0 net/ipv4/ip_input.c:575 ip_list_rcv_finish net/ipv4/ip_input.c:625 [inline] ip_sublist_rcv+0x533/0x980 net/ipv4/ip_input.c:633 ip_list_rcv+0x31a/0x470 net/ipv4/ip_input.c:668 __netif_receive_skb_list_ptype net/core/dev.c:5528 [inline] __netif_receive_skb_list_core+0x548/0x8f0 net/core/dev.c:5576 __netif_receive_skb_list net/core/dev.c:5628 [inline] netif_receive_skb_list_internal+0x75b/0xd80 net/core/dev.c:5719 gro_normal_list include/net/gro.h:430 [inline] gro_normal_list include/net/gro.h:426 [inline] napi_complete_done+0x1f1/0x880 net/core/dev.c:6060 virtqueue_napi_complete drivers/net/virtio_net.c:398 [inline] virtnet_poll+0xd0c/0x1310 drivers/net/virtio_net.c:1675 __napi_poll+0xb3/0x6d0 net/core/dev.c:6511 napi_poll net/core/dev.c:6578 [inline] net_rx_action+0x9c1/0xd90 net/core/dev.c:6689 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 The buggy address belongs to the object at ffff888020c53000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 152 bytes inside of 512-byte region [ffff888020c53000, ffff888020c53200) The buggy address belongs to the physical page: page:ffffea0000831400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20c50 head:ffffea0000831400 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888011841c80 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1561, tgid 1561 (kworker/u4:2), ts 7133970434, free_ts 0 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5549 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:1829 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x7f1/0xe10 mm/slub.c:3036 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3123 slab_alloc_node mm/slub.c:3214 [inline] slab_alloc mm/slub.c:3256 [inline] kmem_cache_alloc_trace+0x323/0x3e0 mm/slub.c:3287 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] alloc_bprm+0x51/0x900 fs/exec.c:1507 kernel_execve+0xab/0x500 fs/exec.c:1967 call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 page_owner free stack trace missing Memory state around the buggy address: ffff888020c52f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888020c53000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888020c53080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020c53100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020c53180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================