================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4925 Read of size 8 at addr ffff8880445b0970 by task ksoftirqd/0/15 CPU: 0 PID: 15 Comm: ksoftirqd/0 Not tainted 6.1.0-syzkaller-13872-gb6bb9676f216 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x15e/0x45d mm/kasan/report.c:417 kasan_report+0xbf/0x1f0 mm/kasan/report.c:517 __lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4925 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162 try_to_wake_up+0xb2/0x2080 kernel/sched/core.c:4100 rxrpc_wake_up_io_thread net/rxrpc/ar-internal.h:966 [inline] rxrpc_error_report+0x15f/0x390 net/rxrpc/io_thread.c:65 sk_error_report+0x3d/0x3b0 net/core/sock.c:345 sock_queue_err_skb+0x36f/0x7c0 net/core/skbuff.c:4871 ip_icmp_error+0x457/0x980 net/ipv4/ip_sockglue.c:431 rxrpc_encap_err_rcv+0x110/0x140 net/rxrpc/local_object.c:34 __udp4_lib_err+0x8e0/0x1530 net/ipv4/udp.c:793 icmp_socket_deliver+0x1c1/0x360 net/ipv4/icmp.c:826 icmp_unreach+0x356/0xcb0 net/ipv4/icmp.c:946 icmp_rcv+0x885/0x1030 net/ipv4/icmp.c:1266 ip_protocol_deliver_rcu+0x9f/0x460 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2ec/0x4c0 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip_local_deliver+0x1ae/0x200 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:454 [inline] ip_rcv_finish+0x1cf/0x2f0 net/ipv4/ip_input.c:449 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip_rcv+0xae/0xd0 net/ipv4/ip_input.c:569 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5482 __netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5596 process_backlog+0x3e4/0x810 net/core/dev.c:5924 __napi_poll+0xb8/0x770 net/core/dev.c:6485 napi_poll net/core/dev.c:6552 [inline] net_rx_action+0xa00/0xde0 net/core/dev.c:6663 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 run_ksoftirqd kernel/softirq.c:934 [inline] run_ksoftirqd+0x31/0x60 kernel/softirq.c:926 smpboot_thread_fn+0x659/0xa20 kernel/smpboot.c:164 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 2: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x82/0x90 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:761 [inline] slab_alloc_node mm/slub.c:3452 [inline] kmem_cache_alloc_node+0x1f1/0x460 mm/slub.c:3497 alloc_task_struct_node kernel/fork.c:171 [inline] dup_task_struct kernel/fork.c:979 [inline] copy_process+0x3aa/0x7520 kernel/fork.c:2097 kernel_clone+0xeb/0x990 kernel/fork.c:2681 kernel_thread+0xb9/0xf0 kernel/fork.c:2741 create_kthread kernel/kthread.c:399 [inline] kthreadd+0x4f2/0x750 kernel/kthread.c:746 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Freed by task 15: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:518 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3787 [inline] kmem_cache_free+0xee/0x5c0 mm/slub.c:3809 put_task_struct include/linux/sched/task.h:119 [inline] delayed_put_task_struct+0x26e/0x3d0 kernel/exit.c:225 rcu_do_batch kernel/rcu/tree.c:2244 [inline] rcu_core+0x81f/0x1980 kernel/rcu/tree.c:2504 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 __call_rcu_common.constprop.0+0x99/0x820 kernel/rcu/tree.c:2753 put_task_struct_rcu_user+0x83/0xc0 kernel/exit.c:231 context_switch kernel/sched/core.c:5247 [inline] __schedule+0xb92/0x5450 kernel/sched/core.c:6555 schedule+0xde/0x1b0 kernel/sched/core.c:6631 schedule_timeout+0x1e1/0x2a0 kernel/time/timer.c:2143 do_wait_for_common kernel/sched/completion.c:85 [inline] __wait_for_common+0x1ce/0x5c0 kernel/sched/completion.c:106 kthread_stop+0x1c3/0x830 kernel/kthread.c:709 rxrpc_unuse_local+0x102/0x130 net/rxrpc/local_object.c:368 rxrpc_release_sock net/rxrpc/af_rxrpc.c:887 [inline] rxrpc_release+0x20b/0x550 net/rxrpc/af_rxrpc.c:914 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x1c/0x20 net/socket.c:1365 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 __do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 __call_rcu_common.constprop.0+0x99/0x820 kernel/rcu/tree.c:2753 put_task_struct_rcu_user+0x83/0xc0 kernel/exit.c:231 release_task+0xcc8/0x17c0 kernel/exit.c:281 wait_task_zombie kernel/exit.c:1196 [inline] wait_consider_task+0x2fa0/0x3bb0 kernel/exit.c:1423 do_wait_thread kernel/exit.c:1486 [inline] do_wait+0x7cd/0xd70 kernel/exit.c:1603 kernel_wait4+0x150/0x260 kernel/exit.c:1766 __do_compat_sys_wait4+0x137/0x150 kernel/exit.c:1824 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 The buggy address belongs to the object at ffff8880445b0000 which belongs to the cache task_struct of size 7232 The buggy address is located 2416 bytes inside of 7232-byte region [ffff8880445b0000, ffff8880445b1c40) The buggy address belongs to the physical page: page:ffffea0001116c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x445b0 head:ffffea0001116c00 order:3 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 memcg:ffff88802a3fb001 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff8880125ec500 ffffea00007f2200 dead000000000002 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff88802a3fb001 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5121, tgid 5121 (syz-executor.5), ts 167103102484, free_ts 166594819705 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x119c/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5549 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x350 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] kmem_cache_alloc_node+0x1a4/0x460 mm/slub.c:3497 alloc_task_struct_node kernel/fork.c:171 [inline] dup_task_struct kernel/fork.c:979 [inline] copy_process+0x3aa/0x7520 kernel/fork.c:2097 kernel_clone+0xeb/0x990 kernel/fork.c:2681 __do_compat_sys_ia32_clone+0x9e/0xd0 arch/x86/kernel/sys_ia32.c:254 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x65c/0xc00 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3464 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x66/0x90 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:761 [inline] slab_alloc_node mm/slub.c:3452 [inline] __kmem_cache_alloc_node+0x1ea/0x430 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc_node+0x4d/0xd0 mm/slab_common.c:975 kmalloc_node include/linux/slab.h:610 [inline] kvmalloc_node+0xa2/0x1a0 mm/util.c:581 kvmalloc include/linux/slab.h:737 [inline] kvzalloc include/linux/slab.h:745 [inline] bucket_table_alloc.isra.0+0x8c/0x480 lib/rhashtable.c:184 rhashtable_rehash_alloc+0x68/0x110 lib/rhashtable.c:363 rhashtable_shrink lib/rhashtable.c:407 [inline] rht_deferred_worker+0xe63/0x1d70 lib/rhashtable.c:425 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff8880445b0800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880445b0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880445b0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880445b0980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880445b0a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================