==================================================================
BUG: KASAN: slab-use-after-free in rose_timer_expiry+0x471/0x4b0
Read of size 2 at addr ffff888119c77c2a by task udevd/19511

CPU: 0 UID: 0 PID: 19511 Comm: udevd Not tainted 6.17.0-rc1-syzkaller-00207-g815957293639-dirty #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
 <IRQ>
 dump_stack_lvl+0x189/0x250
 print_report+0xca/0x240
 kasan_report+0x118/0x150
 rose_timer_expiry+0x471/0x4b0
 call_timer_fn+0x17e/0x5f0
 __run_timer_base+0x61a/0x860
 run_timer_softirq+0xb7/0x180
 handle_softirqs+0x286/0x870
 __irq_exit_rcu+0xca/0x1f0
 irq_exit_rcu+0x9/0x30
 sysvec_apic_timer_interrupt+0xa6/0xc0
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20
RIP: 0010:do_syscall_64+0xc3/0x3b0
Code: 00 48 8b 7d 08 48 89 7b 18 e8 09 5a 00 00 0f 1f 44 00 00 0f 1f 44 00 00 90 e8 99 35 4e f6 90 90 e8 42 35 4e f6 fb 49 8b 57 08 <f6> c2 3f 74 0e 4c 89 f7 4c 89 ee e8 6d 29 31 f6 49 89 c4 90 90 41
RSP: 0018:ffffc90008037ef0 EFLAGS: 00000286
RAX: 71d81f92e87d3a00 RBX: ffffc90008037ef0 RCX: 71d81f92e87d3a00
RDX: 0000000000000000 RSI: ffffffff8d9b7129 RDI: ffffffff8be33400
RBP: ffffc90008037f48 R08: ffffffff8fa38237 R09: 1ffffffff1f47046
R10: dffffc0000000000 R11: fffffbfff1f47047 R12: 0000000000000106
R13: 0000000000000106 R14: ffffc90008037f58 R15: ffff888107261cc0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f196a1595f4
Code: 64 c7 00 09 00 00 00 83 c8 ff c3 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 00 00 00 00 41 89 ca b8 06 01 00 00 0f 05 <45> 31 c0 3d 00 f0 ff ff 76 10 48 8b 15 03 a8 0d 00 f7 d8 41 83 c8
RSP: 002b:00007ffd2b57d268 EFLAGS: 00000246 ORIG_RAX: 0000000000000106
RAX: ffffffffffffffda RBX: 000000000000000f RCX: 00007f196a1595f4
RDX: 00007ffd2b57d278 RSI: 00007ffd2b57d347 RDI: 00000000ffffff9c
RBP: 00007ffd2b57e380 R08: 00007ffd2b57e398 R09: 00007ffd2b57dd08
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd2b57e398
R13: 0000000000000000 R14: 0000000000000008 R15: 0000556b7156b910
 </TASK>

Allocated by task 20715:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_cache_noprof+0x230/0x3d0
 tomoyo_find_next_domain+0xdc/0x1aa0
 tomoyo_bprm_check_security+0x11c/0x180
 security_bprm_check+0x89/0x270
 bprm_execve+0x8ee/0x1450
 kernel_execve+0x8f0/0x9f0
 call_usermodehelper_exec_async+0x210/0x360
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30

Freed by task 20715:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x46/0x50
 __kasan_slab_free+0x5b/0x80
 kfree+0x18e/0x440
 tomoyo_find_next_domain+0x173e/0x1aa0
 tomoyo_bprm_check_security+0x11c/0x180
 security_bprm_check+0x89/0x270
 bprm_execve+0x8ee/0x1450
 kernel_execve+0x8f0/0x9f0
 call_usermodehelper_exec_async+0x210/0x360
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30

The buggy address belongs to the object at ffff888119c77c00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 42 bytes inside of
 freed 512-byte region [ffff888119c77c00, ffff888119c77e00)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888119c75000 pfn:0x119c74
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x57ff00000000240(workingset|head|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000240 ffff88801a441c80 ffffea00046d3710 ffffea000402a710
raw: ffff888119c75000 000000000010000e 00000000f5000000 0000000000000000
head: 057ff00000000240 ffff88801a441c80 ffffea00046d3710 ffffea000402a710
head: ffff888119c75000 000000000010000e 00000000f5000000 0000000000000000
head: 057ff00000000002 ffffea0004671d01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2, tgid 2 (kthreadd), ts 57597654115, free_ts 57594514019
 post_alloc_hook+0x240/0x2a0
 get_page_from_freelist+0x21e4/0x22c0
 __alloc_frozen_pages_noprof+0x181/0x370
 alloc_pages_mpol+0x232/0x4a0
 allocate_slab+0x8a/0x370
 ___slab_alloc+0xbeb/0x1410
 __kmalloc_cache_noprof+0x296/0x3d0
 set_kthread_struct+0xbb/0x340
 copy_process+0x10c4/0x3c00
 kernel_clone+0x21e/0x840
 kernel_thread+0x10c/0x160
 kthreadd+0x575/0x770
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30
page last free pid 5838 tgid 5838 stack trace:
 __free_frozen_pages+0xbc4/0xd30
 stack_depot_save_flags+0x436/0x860
 kasan_save_track+0x4f/0x80
 __kasan_slab_alloc+0x6c/0x80
 kmem_cache_alloc_noprof+0x1c1/0x3c0
 wg_peer_create+0xe8/0x8a0
 wg_set_device+0x10f3/0x1fe0
 genl_family_rcv_msg_doit+0x215/0x300
 genl_rcv_msg+0x60e/0x790
 netlink_rcv_skb+0x208/0x470
 genl_rcv+0x28/0x40
 netlink_unicast+0x82f/0x9e0
 netlink_sendmsg+0x805/0xb30
 __sock_sendmsg+0x21c/0x270
 __sys_sendto+0x3bd/0x520
 __x64_sys_sendto+0xde/0x100

Memory state around the buggy address:
 ffff888119c77b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888119c77b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888119c77c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff888119c77c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888119c77d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
