================================================================== BUG: KASAN: invalid-free in init_file+0x195/0x200 fs/file_table.c:163 Free of addr ffff88807becc400 by task syz-executor.3/14975 CPU: 0 PID: 14975 Comm: syz-executor.3 Not tainted 6.4.0-syzkaller-09904-ga507db1d8fdc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/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_invalid_free+0xeb/0x110 mm/kasan/report.c:550 ____kasan_slab_free+0xfb/0x120 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+0x292/0x500 mm/slub.c:3823 init_file+0x195/0x200 fs/file_table.c:163 alloc_empty_backing_file+0x67/0xd0 fs/file_table.c:267 backing_file_open+0x26/0x100 fs/open.c:1171 ovl_open_realfile+0x1f6/0x350 fs/overlayfs/file.c:64 ovl_real_fdget_meta+0x3be/0x4b0 fs/overlayfs/file.c:131 ovl_real_fdget fs/overlayfs/file.c:152 [inline] ovl_splice_read+0x1a5/0x670 fs/overlayfs/file.c:447 splice_direct_to_actor+0x2c4/0x9e0 fs/splice.c:1070 do_splice_direct+0x2ac/0x3f0 fs/splice.c:1195 do_sendfile+0x623/0x1070 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1308 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:0x7f9cce48c389 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:00007f9ccf2aa168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f9cce5abf80 RCX: 00007f9cce48c389 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 00007f9ccf2aa1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 000000007ffff000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fffc7c343df R14: 00007f9ccf2aa300 R15: 0000000000022000 Allocated by task 14975: 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 kmalloc include/linux/slab.h:579 [inline] kzalloc include/linux/slab.h:700 [inline] alloc_empty_backing_file+0x52/0xd0 fs/file_table.c:263 backing_file_open+0x26/0x100 fs/open.c:1171 ovl_open_realfile+0x1f6/0x350 fs/overlayfs/file.c:64 ovl_real_fdget_meta+0x3be/0x4b0 fs/overlayfs/file.c:131 ovl_real_fdget fs/overlayfs/file.c:152 [inline] ovl_splice_read+0x1a5/0x670 fs/overlayfs/file.c:447 splice_direct_to_actor+0x2c4/0x9e0 fs/splice.c:1070 do_splice_direct+0x2ac/0x3f0 fs/splice.c:1195 do_sendfile+0x623/0x1070 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1308 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:491 insert_work+0x54/0x3d0 kernel/workqueue.c:1553 __queue_work+0xb37/0xf10 kernel/workqueue.c:1714 call_timer_fn+0x178/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x67a/0x860 kernel/time/timer.c:2022 run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2035 __do_softirq+0x2ab/0x908 kernel/softirq.c:553 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:491 insert_work+0x54/0x3d0 kernel/workqueue.c:1553 __queue_work+0xb37/0xf10 kernel/workqueue.c:1714 call_timer_fn+0x178/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x67a/0x860 kernel/time/timer.c:2022 run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2035 __do_softirq+0x2ab/0x908 kernel/softirq.c:553 The buggy address belongs to the object at ffff88807becc400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 480-byte region [ffff88807becc400, ffff88807becc5e0) The buggy address belongs to the physical page: page:ffffea0001efb300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7becc head:ffffea0001efb300 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012841c80 dead000000000100 dead000000000122 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5085, tgid 5085 (kworker/0:4), ts 230083909236, free_ts 229982332037 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 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc+0xa8/0x230 mm/slab_common.c:998 kmalloc include/linux/slab.h:583 [inline] kzalloc include/linux/slab.h:700 [inline] __cfg80211_bss_update+0x1a5/0x2100 net/wireless/scan.c:1800 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_sta_join_ibss+0xd31/0x1610 net/mac80211/ibss.c:386 ieee80211_sta_create_ibss+0x36e/0x610 net/mac80211/ibss.c:1352 ieee80211_sta_find_ibss net/mac80211/ibss.c:1482 [inline] ieee80211_ibss_work+0xdd7/0x1490 net/mac80211/ibss.c:1709 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 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 __stack_depot_save+0x4ef/0x650 lib/stackdepot.c:443 kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x61/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x66/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:750 slab_alloc_node mm/slub.c:3470 [inline] slab_alloc mm/slub.c:3478 [inline] __kmem_cache_alloc_lru mm/slub.c:3485 [inline] kmem_cache_alloc+0x123/0x300 mm/slub.c:3494 kmem_cache_zalloc include/linux/slab.h:690 [inline] fill_pool lib/debugobjects.c:168 [inline] debug_objects_fill_pool+0x6f1/0x990 lib/debugobjects.c:615 __debug_object_init+0x29/0x310 lib/debugobjects.c:628 debug_timer_init kernel/time/timer.c:777 [inline] debug_init kernel/time/timer.c:825 [inline] init_timer_key+0x38/0x2e0 kernel/time/timer.c:869 ip_mc_init_dev+0x90/0x1d0 net/ipv4/igmp.c:1773 inetdev_init+0x33c/0x4c0 net/ipv4/devinet.c:294 inetdev_event+0x342/0x1580 net/ipv4/devinet.c:1538 notifier_call_chain+0x18c/0x3a0 kernel/notifier.c:93 call_netdevice_notifiers_info net/core/dev.c:1962 [inline] call_netdevice_notifiers_extack net/core/dev.c:2000 [inline] call_netdevice_notifiers+0x149/0x1c0 net/core/dev.c:2014 register_netdevice+0x1349/0x1790 net/core/dev.c:10084 Memory state around the buggy address: ffff88807becc300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807becc380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807becc400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88807becc480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807becc500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================