================================================================== BUG: KASAN: use-after-free in process_notifier+0x343/0x7b0 drivers/misc/uid_sys_stats.c:707 Write of size 8 at addr ffff88811aa19758 by task kworker/dying/30918 CPU: 1 PID: 30918 Comm: kworker/dying Tainted: G W 6.1.25-syzkaller-00052-g37edfbc5c467 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 __asan_report_store8_noabort+0x17/0x20 mm/kasan/report_generic.c:356 process_notifier+0x343/0x7b0 drivers/misc/uid_sys_stats.c:707 notifier_call_chain kernel/notifier.c:87 [inline] blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:382 profile_task_exit+0x1e/0x30 kernel/profile.c:146 do_exit+0x2c1/0x2b80 kernel/exit.c:819 kthread_exit+0x46/0x60 kernel/kthread.c:306 kthread+0x28b/0x300 kernel/kthread.c:378 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 30918: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:379 [inline] __kasan_kmalloc+0x9c/0xb0 mm/kasan/common.c:388 kasan_kmalloc include/linux/kasan.h:212 [inline] kmalloc_trace+0x44/0xa0 mm/slab_common.c:1052 kmalloc include/linux/slab.h:553 [inline] process_notifier+0x2c1/0x7b0 drivers/misc/uid_sys_stats.c:695 notifier_call_chain kernel/notifier.c:87 [inline] blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:382 profile_task_exit+0x1e/0x30 kernel/profile.c:146 do_exit+0x2c1/0x2b80 kernel/exit.c:819 kthread_exit+0x46/0x60 kernel/kthread.c:306 kthread+0x28b/0x300 kernel/kthread.c:378 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb4/0xc0 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496 call_rcu+0xec/0x1230 kernel/rcu/tree.c:2798 nf_hook_entries_free net/netfilter/core.c:88 [inline] __nf_unregister_net_hook+0x4bc/0x680 net/netfilter/core.c:514 nf_unregister_net_hooks+0xdb/0x140 net/netfilter/core.c:601 ip6t_unregister_table_pre_exit+0x80/0xb0 net/ipv6/netfilter/ip6_tables.c:1797 ip6table_filter_net_pre_exit+0x1c/0x20 net/ipv6/netfilter/ip6table_filter.c:63 ops_pre_exit_list net/core/net_namespace.c:159 [inline] cleanup_net+0x522/0xbf0 net/core/net_namespace.c:589 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2296 worker_thread+0xa60/0x1260 kernel/workqueue.c:2443 kthread+0x26d/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb4/0xc0 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496 kvfree_call_rcu+0x9f/0x800 kernel/rcu/tree.c:3343 tipc_nametbl_remove_publ+0x195a/0x1b40 net/tipc/name_table.c:535 tipc_nametbl_withdraw+0x147/0x390 net/tipc/name_table.c:809 tipc_sk_withdraw net/tipc/socket.c:2939 [inline] tipc_release+0x358/0x1300 net/tipc/socket.c:645 __sock_release net/socket.c:652 [inline] sock_release+0x7e/0x140 net/socket.c:680 tipc_topsrv_stop net/tipc/topsrv.c:713 [inline] tipc_topsrv_exit_net+0x2b7/0x320 net/tipc/topsrv.c:725 ops_exit_list net/core/net_namespace.c:169 [inline] cleanup_net+0x64b/0xbf0 net/core/net_namespace.c:601 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2296 worker_thread+0xa60/0x1260 kernel/workqueue.c:2443 kthread+0x26d/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff88811aa19700 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 88 bytes inside of 96-byte region [ffff88811aa19700, ffff88811aa19760) The buggy address belongs to the physical page: page:ffffea00046a8640 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11aa19 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea00044e9b00 dead000000000004 ffff888100042900 raw: 0000000000000000 0000000080200020 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 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 29761, tgid 29747 (syz-executor.5), ts 1829852191515, free_ts 1829843882913 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2582 prep_new_page+0x1b/0x110 mm/page_alloc.c:2589 get_page_from_freelist+0x2762/0x27f0 mm/page_alloc.c:4387 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5664 allocate_slab mm/slub.c:1959 [inline] new_slab+0xce/0x4c0 mm/slub.c:2012 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3200 __slab_alloc+0x5d/0xa0 mm/slub.c:3299 slab_alloc_node mm/slub.c:3384 [inline] __kmem_cache_alloc_node+0x1af/0x250 mm/slub.c:3457 __do_kmalloc_node mm/slab_common.c:956 [inline] __kmalloc+0xa3/0x1e0 mm/slab_common.c:970 kmalloc_array include/linux/slab.h:605 [inline] kcalloc include/linux/slab.h:636 [inline] ext4_find_extent+0x370/0xdb0 fs/ext4/extents.c:914 ext4_ext_map_blocks+0x255/0x71e0 fs/ext4/extents.c:4103 ext4_map_blocks+0xa42/0x1ce0 fs/ext4/inode.c:651 ext4_getblk+0x1eb/0x7b0 fs/ext4/inode.c:864 ext4_bread+0x2f/0x180 fs/ext4/inode.c:920 ext4_append+0x31f/0x5b0 fs/ext4/namei.c:83 ext4_init_new_dir+0x33f/0x620 fs/ext4/namei.c:2955 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1494 [inline] free_pcp_prepare mm/page_alloc.c:1568 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3486 free_unref_page+0x8d/0x480 mm/page_alloc.c:3582 __folio_put_small mm/swap.c:105 [inline] __folio_put+0xaa/0xe0 mm/swap.c:128 folio_put include/linux/mm.h:1415 [inline] put_page include/linux/mm.h:1467 [inline] anon_pipe_buf_release+0x187/0x200 fs/pipe.c:138 pipe_buf_release include/linux/pipe_fs_i.h:183 [inline] pipe_read+0x5a6/0x1040 fs/pipe.c:324 call_read_iter include/linux/fs.h:2209 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x771/0xad0 fs/read_write.c:470 ksys_read+0x199/0x2c0 fs/read_write.c:613 __do_sys_read fs/read_write.c:623 [inline] __se_sys_read fs/read_write.c:621 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:621 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 Memory state around the buggy address: ffff88811aa19600: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88811aa19680: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88811aa19700: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88811aa19780: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88811aa19800: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ==================================================================