================================================================== BUG: KASAN: slab-use-after-free in reiserfs_write_lock+0x5c/0xd0 fs/reiserfs/lock.c:26 Read of size 8 at addr ffff88804f43eb38 by task syz-executor.1/9131 CPU: 1 PID: 9131 Comm: syz-executor.1 Not tainted 6.5.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 reiserfs_write_lock+0x5c/0xd0 fs/reiserfs/lock.c:26 reiserfs_lookup+0x162/0x580 fs/reiserfs/namei.c:364 lookup_one_qstr_excl+0x11b/0x250 fs/namei.c:1605 do_renameat2+0x6e1/0x1660 fs/namei.c:4959 __do_sys_renameat2 fs/namei.c:5042 [inline] __se_sys_renameat2 fs/namei.c:5039 [inline] __x64_sys_renameat2+0xd2/0xe0 fs/namei.c:5039 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f628dc7cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f628ea2d0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007f628dd9bf80 RCX: 00007f628dc7cae9 RDX: 0000000000000004 RSI: 0000000020000080 RDI: 0000000000000005 RBP: 00007f628dcc847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020000200 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f628dd9bf80 R15: 00007ffd129a3a18 Allocated by task 5039: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:985 [inline] __kmalloc+0xb9/0x230 mm/slab_common.c:998 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:703 [inline] tomoyo_encode2 security/tomoyo/realpath.c:45 [inline] tomoyo_encode+0x26f/0x530 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x598/0x5e0 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x254/0x4e0 security/tomoyo/file.c:771 security_file_open+0x63/0xa0 security/security.c:2797 do_dentry_open+0x325/0x1470 fs/open.c:901 do_open fs/namei.c:3636 [inline] path_openat+0x27bb/0x3180 fs/namei.c:3793 do_filp_open+0x234/0x490 fs/namei.c:3820 do_sys_openat2+0x13e/0x1d0 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_sys_openat fs/open.c:1438 [inline] __se_sys_openat fs/open.c:1433 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1433 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5039: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook mm/slub.c:1818 [inline] slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0x25f/0x3b0 mm/slub.c:3814 tomoyo_check_open_permission+0x3b7/0x4e0 security/tomoyo/file.c:786 security_file_open+0x63/0xa0 security/security.c:2797 do_dentry_open+0x325/0x1470 fs/open.c:901 do_open fs/namei.c:3636 [inline] path_openat+0x27bb/0x3180 fs/namei.c:3793 do_filp_open+0x234/0x490 fs/namei.c:3820 do_sys_openat2+0x13e/0x1d0 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_sys_openat fs/open.c:1438 [inline] __se_sys_openat fs/open.c:1433 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1433 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xad/0xc0 mm/kasan/generic.c:492 kvfree_call_rcu+0xf8/0x790 kernel/rcu/tree.c:3368 cfg80211_update_known_bss+0x166/0x9e0 __cfg80211_bss_update+0x153/0x2100 net/wireless/scan.c:1788 cfg80211_inform_single_bss_frame_data net/wireless/scan.c:2881 [inline] cfg80211_inform_bss_frame_data+0xe41/0x1870 net/wireless/scan.c:2912 ieee80211_bss_info_update+0x80c/0xb20 net/mac80211/scan.c:211 ieee80211_rx_bss_info net/mac80211/ibss.c:1124 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1613 [inline] ieee80211_ibss_rx_queued_mgmt+0x18e5/0x2ca0 net/mac80211/ibss.c:1642 ieee80211_iface_process_skb net/mac80211/iface.c:1604 [inline] ieee80211_iface_work+0x7bd/0xcf0 net/mac80211/iface.c:1658 cfg80211_wiphy_work+0x21e/0x250 net/wireless/core.c:435 process_one_work+0x92c/0x12c0 kernel/workqueue.c:2597 worker_thread+0xa63/0x1210 kernel/workqueue.c:2748 kthread+0x2b8/0x350 kernel/kthread.c:389 ret_from_fork+0x2e/0x60 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xad/0xc0 mm/kasan/generic.c:492 kvfree_call_rcu+0xf8/0x790 kernel/rcu/tree.c:3368 cfg80211_update_known_bss+0x166/0x9e0 __cfg80211_bss_update+0x153/0x2100 net/wireless/scan.c:1788 cfg80211_inform_single_bss_frame_data net/wireless/scan.c:2881 [inline] cfg80211_inform_bss_frame_data+0xe41/0x1870 net/wireless/scan.c:2912 ieee80211_bss_info_update+0x80c/0xb20 net/mac80211/scan.c:211 ieee80211_rx_bss_info net/mac80211/ibss.c:1124 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1613 [inline] ieee80211_ibss_rx_queued_mgmt+0x18e5/0x2ca0 net/mac80211/ibss.c:1642 ieee80211_iface_process_skb net/mac80211/iface.c:1604 [inline] ieee80211_iface_work+0x7bd/0xcf0 net/mac80211/iface.c:1658 cfg80211_wiphy_work+0x21e/0x250 net/wireless/core.c:435 process_one_work+0x92c/0x12c0 kernel/workqueue.c:2597 worker_thread+0xa63/0x1210 kernel/workqueue.c:2748 kthread+0x2b8/0x350 kernel/kthread.c:389 ret_from_fork+0x2e/0x60 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the object at ffff88804f43eb00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 56 bytes inside of freed 96-byte region [ffff88804f43eb00, ffff88804f43eb60) The buggy address belongs to the physical page: page:ffffea00013d0f80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4f43e flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff888012841780 ffffea0000a9dd00 dead000000000006 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 9, tgid 9 (kworker/0:1), ts 93983355560, free_ts 93972712779 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x31e8/0x3370 mm/page_alloc.c:3221 __alloc_pages+0x255/0x670 mm/page_alloc.c:4477 alloc_slab_page+0x6a/0x160 mm/slub.c:1862 allocate_slab mm/slub.c:2009 [inline] new_slab+0x84/0x2f0 mm/slub.c:2062 ___slab_alloc+0xade/0x1100 mm/slub.c:3215 __slab_alloc mm/slub.c:3314 [inline] __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x1af/0x270 mm/slub.c:3509 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1076 kmalloc include/linux/slab.h:582 [inline] dst_cow_metrics_generic+0x56/0x1c0 net/core/dst.c:180 dst_metrics_write_ptr include/net/dst.h:133 [inline] dst_metric_set include/net/dst.h:194 [inline] icmp6_dst_alloc+0x269/0x400 net/ipv6/route.c:3274 ndisc_send_skb+0x30f/0x1390 net/ipv6/ndisc.c:488 addrconf_dad_completed+0x7fc/0xd10 net/ipv6/addrconf.c:4259 addrconf_dad_work+0xd92/0x16b0 process_one_work+0x92c/0x12c0 kernel/workqueue.c:2597 worker_thread+0xa63/0x1210 kernel/workqueue.c:2748 kthread+0x2b8/0x350 kernel/kthread.c:389 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2348 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2443 tlb_batch_list_free mm/mmu_gather.c:113 [inline] tlb_finish_mmu+0x11f/0x1f0 mm/mmu_gather.c:394 exit_mmap+0x3e2/0xad0 mm/mmap.c:3215 __mmput+0x115/0x3c0 kernel/fork.c:1348 exit_mm+0x21f/0x300 kernel/exit.c:567 do_exit+0x612/0x2290 kernel/exit.c:861 do_group_exit+0x206/0x2c0 kernel/exit.c:1024 get_signal+0x1709/0x17e0 kernel/signal.c:2881 arch_do_signal_or_restart+0x91/0x670 arch/x86/kernel/signal.c:308 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:297 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88804f43ea00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff88804f43ea80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff88804f43eb00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88804f43eb80: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff88804f43ec00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ==================================================================