loop1: detected capacity change from 0 to 2048 ================================================================== BUG: KASAN: use-after-free in nilfs_mdt_destroy+0x4f/0x70 fs/nilfs2/mdt.c:497 Read of size 8 at addr ffff88802b651898 by task syz-executor.1/30527 CPU: 0 PID: 30527 Comm: syz-executor.1 Not tainted 6.0.0-syzkaller-03015-g2bca25eaeba6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:317 print_report+0x108/0x1f0 mm/kasan/report.c:433 kasan_report+0xc3/0xf0 mm/kasan/report.c:495 nilfs_mdt_destroy+0x4f/0x70 fs/nilfs2/mdt.c:497 nilfs_free_inode+0x44/0x70 fs/nilfs2/super.c:168 i_callback fs/inode.c:249 [inline] alloc_inode fs/inode.c:274 [inline] iget5_locked+0x23d/0x270 fs/inode.c:1242 nilfs_iget_locked fs/nilfs2/inode.c:588 [inline] nilfs_iget+0x162/0x8b0 fs/nilfs2/inode.c:597 nilfs_lookup+0xca/0x110 fs/nilfs2/namei.c:63 __lookup_slow+0x266/0x3a0 fs/namei.c:1685 lookup_slow+0x53/0x70 fs/namei.c:1702 walk_component fs/namei.c:1993 [inline] link_path_walk+0xa06/0xf00 fs/namei.c:2320 path_parentat fs/namei.c:2521 [inline] filename_parentat+0x274/0x6c0 fs/namei.c:2544 do_renameat2+0x2b5/0x1370 fs/namei.c:4820 __do_sys_rename fs/namei.c:4953 [inline] __se_sys_rename fs/namei.c:4951 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:4951 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+0x63/0xcd RIP: 0033:0x7f6a5ba8a5a9 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6a5ccc1168 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007f6a5bbabf80 RCX: 00007f6a5ba8a5a9 RDX: 0000000000000000 RSI: 0000000020000800 RDI: 00000000200001c0 RBP: 00007f6a5ccc11d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffe6f47391f R14: 00007f6a5ccc1300 R15: 0000000000022000 Allocated by task 12: 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:437 [inline] ____kasan_kmalloc+0xcd/0x100 mm/kasan/common.c:516 kasan_kmalloc include/linux/kasan.h:234 [inline] kmem_cache_alloc_trace+0x97/0x310 mm/slub.c:3289 kmalloc include/linux/slab.h:600 [inline] batadv_forw_packet_alloc+0x122/0x3a0 net/batman-adv/send.c:519 batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:563 [inline] batadv_iv_ogm_queue_add+0x713/0xc20 net/batman-adv/bat_iv_ogm.c:671 batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:834 [inline] batadv_iv_ogm_schedule+0x849/0x1020 net/batman-adv/bat_iv_ogm.c:869 batadv_iv_send_outstanding_bat_ogm_packet+0x741/0x850 net/batman-adv/bat_iv_ogm.c:1713 process_one_work+0x877/0xdb0 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 25724: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x60 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kfree+0xda/0x210 mm/slub.c:4567 process_one_work+0x877/0xdb0 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Last potentially related work creation: kasan_save_stack+0x2b/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1358 __queue_work+0xa31/0xce0 kernel/workqueue.c:1517 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers+0x7a2/0x980 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x277/0x738 kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x2b/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1358 __queue_work+0xa31/0xce0 kernel/workqueue.c:1517 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers+0x7a2/0x980 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x277/0x738 kernel/softirq.c:571 The buggy address belongs to the object at ffff88802b651800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 152 bytes inside of 512-byte region [ffff88802b651800, ffff88802b651a00) The buggy address belongs to the physical page: page:ffffea0000ad9400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802b653c00 pfn:0x2b650 head:ffffea0000ad9400 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001f33308 ffffea0000afad08 ffff888012041c80 raw: ffff88802b653c00 000000000010000e 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 3637, tgid 3637 (syz-executor.4), ts 104056684191, free_ts 0 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 alloc_slab_page+0x70/0xf0 mm/slub.c:1829 allocate_slab+0x5e/0x520 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x3ee/0xc40 mm/slub.c:3036 __slab_alloc mm/slub.c:3123 [inline] slab_alloc_node mm/slub.c:3214 [inline] __kmalloc_node_track_caller+0x2c3/0x400 mm/slub.c:4964 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0x112/0x2b0 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1265 [inline] alloc_uevent_skb+0x73/0x220 lib/kobject_uevent.c:290 uevent_net_broadcast_tagged lib/kobject_uevent.c:351 [inline] kobject_uevent_net_broadcast+0x177/0x570 lib/kobject_uevent.c:412 kobject_uevent_env+0x6b1/0x8e0 lib/kobject_uevent.c:593 netdev_queue_add_kobject net/core/net-sysfs.c:1677 [inline] netdev_queue_update_kobjects+0x250/0x4c0 net/core/net-sysfs.c:1718 register_queue_kobjects net/core/net-sysfs.c:1779 [inline] netdev_register_kobject+0x263/0x310 net/core/net-sysfs.c:2019 register_netdevice+0x1043/0x1790 net/core/dev.c:10053 geneve_configure+0x6cd/0xa60 drivers/net/geneve.c:1432 geneve_newlink+0xfa/0x1a0 drivers/net/geneve.c:1683 rtnl_newlink_create net/core/rtnetlink.c:3364 [inline] __rtnl_newlink net/core/rtnetlink.c:3581 [inline] rtnl_newlink+0x147d/0x1fa0 net/core/rtnetlink.c:3594 page_owner free stack trace missing Memory state around the buggy address: ffff88802b651780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802b651800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802b651880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802b651900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802b651980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================