================================================================== BUG: KASAN: slab-use-after-free in pwq_release_workfn+0x22c/0x230 kernel/workqueue.c:4124 Read of size 4 at addr ffff00014285f9c0 by task pool_workqueue_/3 CPU: 1 PID: 3 Comm: pool_workqueue_ Not tainted 6.6.0-rc4-syzkaller-g19af4a4ed414 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233 show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x174/0x514 mm/kasan/report.c:475 kasan_report+0xd8/0x138 mm/kasan/report.c:588 __asan_report_load4_noabort+0x20/0x2c mm/kasan/report_generic.c:380 pwq_release_workfn+0x22c/0x230 kernel/workqueue.c:4124 kthread_worker_fn+0x408/0xabc kernel/kthread.c:823 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:857 Allocated by task 30977: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:511 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] kmalloc_trace+0x70/0x88 mm/slab_common.c:1119 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] alloc_workqueue+0x15c/0xf20 kernel/workqueue.c:4684 wg_newlink+0x21c/0x610 drivers/net/wireguard/device.c:343 rtnl_newlink_create net/core/rtnetlink.c:3485 [inline] __rtnl_newlink net/core/rtnetlink.c:3705 [inline] rtnl_newlink+0x1140/0x1b64 net/core/rtnetlink.c:3718 rtnetlink_rcv_msg+0x748/0xdc0 net/core/rtnetlink.c:6444 netlink_rcv_skb+0x214/0x3c4 net/netlink/af_netlink.c:2545 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6462 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x83c/0xb20 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg net/socket.c:753 [inline] ____sys_sendmsg+0x56c/0x840 net/socket.c:2541 ___sys_sendmsg net/socket.c:2595 [inline] __sys_sendmsg+0x26c/0x33c net/socket.c:2624 __do_sys_sendmsg net/socket.c:2633 [inline] __se_sys_sendmsg net/socket.c:2631 [inline] __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2631 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 Freed by task 30977: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:522 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0x2ac/0x480 mm/slub.c:3822 kfree+0xb8/0x19c mm/slab_common.c:1072 alloc_workqueue+0xbe4/0xf20 kernel/workqueue.c:4746 wg_newlink+0x21c/0x610 drivers/net/wireguard/device.c:343 rtnl_newlink_create net/core/rtnetlink.c:3485 [inline] __rtnl_newlink net/core/rtnetlink.c:3705 [inline] rtnl_newlink+0x1140/0x1b64 net/core/rtnetlink.c:3718 rtnetlink_rcv_msg+0x748/0xdc0 net/core/rtnetlink.c:6444 netlink_rcv_skb+0x214/0x3c4 net/netlink/af_netlink.c:2545 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6462 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x83c/0xb20 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg net/socket.c:753 [inline] ____sys_sendmsg+0x56c/0x840 net/socket.c:2541 ___sys_sendmsg net/socket.c:2595 [inline] __sys_sendmsg+0x26c/0x33c net/socket.c:2624 __do_sys_sendmsg net/socket.c:2633 [inline] __se_sys_sendmsg net/socket.c:2631 [inline] __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2631 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 The buggy address belongs to the object at ffff00014285f800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 448 bytes inside of freed 512-byte region [ffff00014285f800, ffff00014285fa00) The buggy address belongs to the physical page: page:000000007dfe697c refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x18285c head:000000007dfe697c order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000840(slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000840 ffff0000c0001c80 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff00014285f880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff00014285f900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff00014285f980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff00014285fa00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff00014285fa80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================