==================================================================
BUG: KASAN: slab-use-after-free in rose_timer_expiry+0x471/0x4b0
Read of size 2 at addr ffff8880309a902a by task syz.1.9579/27857

CPU: 0 UID: 0 PID: 27857 Comm: syz.1.9579 Not tainted 6.16.0-syzkaller-06588-g759dfc7d04ba-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:deref_stack_reg+0xa5/0x230
Code: 00 00 00 fc ff df 4c 89 74 24 08 4d 8b 77 10 4c 89 fd 48 c1 ed 03 0f b6 44 35 00 84 c0 0f 85 3c 01 00 00 41 83 3f 00 0f 95 c0 <4c> 39 c3 0f 96 c1 20 c1 4d 39 c6 0f 97 c0 20 c8 3c 01 75 18 49 8d
RSP: 0000:ffffc900032ef0a0 EFLAGS: 00000202
RAX: 0000000000000001 RBX: ffffc900032e8000 RCX: 0000000000000000
RDX: ffffc900032ef208 RSI: dffffc0000000000 RDI: ffffc900032ef1c8
RBP: 1ffff9200065de39 R08: ffffc900032efbd0 R09: 0000000000000000
R10: ffffc900032ef218 R11: fffff5200065de45 R12: 1ffff9200065de3a
R13: 1ffff9200065de3b R14: ffffc900032f0000 R15: ffffc900032ef1c8
 unwind_next_frame+0x17c4/0x2390
 arch_stack_walk+0x11c/0x150
 stack_trace_save+0x9c/0xe0
 save_stack+0xf5/0x1f0
 __set_page_owner+0x8d/0x4a0
 post_alloc_hook+0x240/0x2a0
 get_page_from_freelist+0x21e4/0x22c0
 __alloc_frozen_pages_noprof+0x181/0x370
 alloc_pages_mpol+0x232/0x4a0
 vma_alloc_folio_noprof+0xe4/0x200
 folio_prealloc+0x30/0x180
 do_wp_page+0x1231/0x5800
 __handle_mm_fault+0x1144/0x5620
 handle_mm_fault+0x40a/0x8e0
 do_user_addr_fault+0xa81/0x1390
 exc_page_fault+0x76/0xf0
 asm_exc_page_fault+0x26/0x30
RIP: 0033:0x7f5bb6256066
Code: 00 00 00 00 53 48 89 fb 48 85 ff 74 47 80 3d 94 f6 e8 00 00 75 1e 80 3d 5f c0 35 00 00 75 55 48 8b 43 10 48 c7 00 00 00 00 00 <c6> 43 38 00 5b c3 0f 1f 40 00 8b 3b 31 d2 31 c0 be 68 63 00 00 e8
RSP: 002b:00007ffd7f750220 EFLAGS: 00010246
RAX: 00007f5bb59ff000 RBX: 00007f5bb65b6038 RCX: 00007f5bb6346187
RDX: 00007f5bb65b5fa0 RSI: 00007f5bb65b5fa0 RDI: 00007f5bb65b6038
RBP: 0000000000000000 R08: 00007f5bb65b5fa0 R09: 00007ffd7f7500c7
R10: 0000000000000008 R11: 0000000000000246 R12: 00007f5bb65b5fac
R13: 00007f5bb65b5fa0 R14: 0000000000001c4e R15: 0000000000000003
 </TASK>

Allocated by task 27734:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_cache_noprof+0x230/0x3d0
 j1939_session_new+0x75/0x420
 j1939_tp_send+0x338/0x8c0
 j1939_sk_sendmsg+0xaf8/0x1350
 __sock_sendmsg+0x21c/0x270
 ____sys_sendmsg+0x52d/0x830
 ___sys_sendmsg+0x21f/0x2a0
 __sys_sendmmsg+0x227/0x430
 __x64_sys_sendmmsg+0xa0/0xc0
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 27734:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x46/0x50
 __kasan_slab_free+0x62/0x70
 kfree+0x18e/0x440
 j1939_sk_sendmsg+0x10a0/0x1350
 __sock_sendmsg+0x21c/0x270
 ____sys_sendmsg+0x52d/0x830
 ___sys_sendmsg+0x21f/0x2a0
 __sys_sendmmsg+0x227/0x430
 __x64_sys_sendmmsg+0xa0/0xc0
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

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

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x309a8
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801a441c80 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801a441c80 dead000000000100 dead000000000122
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0000c26a01 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 14932, tgid 14932 (kworker/u10:4), ts 212888679125, free_ts 212761959918
 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/0x3b0
 ___slab_alloc+0xbfc/0x1480
 __kmalloc_cache_noprof+0x296/0x3d0
 alloc_bprm+0x7d/0x5b0
 kernel_execve+0x9b/0x9f0
 call_usermodehelper_exec_async+0x210/0x360
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30
page last free pid 14916 tgid 14913 stack trace:
 __free_frozen_pages+0xc71/0xe70
 stack_depot_save_flags+0x445/0x900
 kasan_save_track+0x4f/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_cache_noprof+0x230/0x3d0
 ref_tracker_alloc+0x133/0x460
 switchdev_deferred_enqueue+0x111/0x240
 __set_ageing_time+0xc8/0x150
 br_init_port+0x131/0x200
 new_nbp+0x2f9/0x440
 br_add_if+0x28e/0xec0
 br_ioctl_stub+0x6aa/0xc80
 sock_ioctl+0x4d8/0x790
 __se_sys_ioctl+0xfc/0x170
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff8880309a8f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880309a8f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880309a9000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff8880309a9080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880309a9100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
