Hay
Date
July 15, 2025, 2:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.141912] ==================================================================
[   19.141997] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   19.142074] Read of size 1 at addr fff00000c6643000 by task kunit_try_catch/215
[   19.142126] 
[   19.142169] CPU: 0 UID: 0 PID: 215 Comm: kunit_try_catch Tainted: G    B            N  6.15.7-rc1 #1 PREEMPT 
[   19.142277] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.142305] Hardware name: linux,dummy-virt (DT)
[   19.142339] Call trace:
[   19.142363]  show_stack+0x20/0x38 (C)
[   19.142414]  dump_stack_lvl+0x8c/0xd0
[   19.142465]  print_report+0x118/0x5d0
[   19.142511]  kasan_report+0xdc/0x128
[   19.142555]  __asan_report_load1_noabort+0x20/0x30
[   19.142606]  kmem_cache_rcu_uaf+0x388/0x468
[   19.142657]  kunit_try_run_case+0x170/0x3f0
[   19.142709]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.142764]  kthread+0x328/0x630
[   19.142811]  ret_from_fork+0x10/0x20
[   19.142860] 
[   19.142879] Allocated by task 215:
[   19.142909]  kasan_save_stack+0x3c/0x68
[   19.142949]  kasan_save_track+0x20/0x40
[   19.142985]  kasan_save_alloc_info+0x40/0x58
[   19.143024]  __kasan_slab_alloc+0xa8/0xb0
[   19.143059]  kmem_cache_alloc_noprof+0x10c/0x398
[   19.143101]  kmem_cache_rcu_uaf+0x12c/0x468
[   19.143141]  kunit_try_run_case+0x170/0x3f0
[   19.143179]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.143236]  kthread+0x328/0x630
[   19.143270]  ret_from_fork+0x10/0x20
[   19.143306] 
[   19.143324] Freed by task 0:
[   19.143349]  kasan_save_stack+0x3c/0x68
[   19.143385]  kasan_save_track+0x20/0x40
[   19.143419]  kasan_save_free_info+0x4c/0x78
[   19.143458]  __kasan_slab_free+0x6c/0x98
[   19.143494]  slab_free_after_rcu_debug+0xd4/0x2f8
[   19.143531]  rcu_core+0x9f4/0x1e20
[   19.143568]  rcu_core_si+0x18/0x30
[   19.143600]  handle_softirqs+0x374/0xb28
[   19.143638]  __do_softirq+0x1c/0x28
[   19.143671] 
[   19.143689] Last potentially related work creation:
[   19.143717]  kasan_save_stack+0x3c/0x68
[   19.143752]  kasan_record_aux_stack+0xb4/0xc8
[   19.143791]  kmem_cache_free+0x120/0x468
[   19.143826]  kmem_cache_rcu_uaf+0x16c/0x468
[   19.143866]  kunit_try_run_case+0x170/0x3f0
[   19.143903]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.143948]  kthread+0x328/0x630
[   19.143984]  ret_from_fork+0x10/0x20
[   19.144020] 
[   19.144037] The buggy address belongs to the object at fff00000c6643000
[   19.144037]  which belongs to the cache test_cache of size 200
[   19.144098] The buggy address is located 0 bytes inside of
[   19.144098]  freed 200-byte region [fff00000c6643000, fff00000c66430c8)
[   19.144162] 
[   19.144183] The buggy address belongs to the physical page:
[   19.144231] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106643
[   19.144287] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.144340] page_type: f5(slab)
[   19.144382] raw: 0bfffe0000000000 fff00000c3e4fdc0 dead000000000122 0000000000000000
[   19.144433] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.144476] page dumped because: kasan: bad access detected
[   19.144508] 
[   19.144525] Memory state around the buggy address:
[   19.144559]  fff00000c6642f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.144604]  fff00000c6642f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.144646] >fff00000c6643000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.144687]                    ^
[   19.144713]  fff00000c6643080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   19.144758]  fff00000c6643100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.144800] ==================================================================

[   11.787872] ==================================================================
[   11.788327] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   11.788571] Read of size 1 at addr ffff888102f40000 by task kunit_try_catch/232
[   11.788809] 
[   11.788918] CPU: 1 UID: 0 PID: 232 Comm: kunit_try_catch Tainted: G    B            N  6.15.7-rc1 #1 PREEMPT(voluntary) 
[   11.788963] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.788974] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.788995] Call Trace:
[   11.789007]  <TASK>
[   11.789024]  dump_stack_lvl+0x73/0xb0
[   11.789049]  print_report+0xd1/0x610
[   11.789071]  ? __virt_addr_valid+0x1db/0x2d0
[   11.789093]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   11.789133]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.789156]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   11.789318]  kasan_report+0x141/0x180
[   11.789343]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   11.789367]  __asan_report_load1_noabort+0x18/0x20
[   11.789393]  kmem_cache_rcu_uaf+0x3e3/0x510
[   11.789412]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   11.789430]  ? finish_task_switch.isra.0+0x153/0x700
[   11.789454]  ? __switch_to+0x5d9/0xf60
[   11.789474]  ? dequeue_task_fair+0x166/0x4e0
[   11.789499]  ? __pfx_read_tsc+0x10/0x10
[   11.789518]  ? ktime_get_ts64+0x86/0x230
[   11.789543]  kunit_try_run_case+0x1a5/0x480
[   11.789563]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.789581]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.789605]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.789628]  ? __kthread_parkme+0x82/0x180
[   11.789649]  ? preempt_count_sub+0x50/0x80
[   11.789672]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.789772]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.789816]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.789838]  kthread+0x337/0x6f0
[   11.789854]  ? trace_preempt_on+0x20/0xc0
[   11.789888]  ? __pfx_kthread+0x10/0x10
[   11.789905]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.789926]  ? calculate_sigpending+0x7b/0xa0
[   11.789947]  ? __pfx_kthread+0x10/0x10
[   11.789964]  ret_from_fork+0x41/0x80
[   11.789984]  ? __pfx_kthread+0x10/0x10
[   11.790000]  ret_from_fork_asm+0x1a/0x30
[   11.790051]  </TASK>
[   11.790072] 
[   11.798681] Allocated by task 232:
[   11.798847]  kasan_save_stack+0x45/0x70
[   11.799255]  kasan_save_track+0x18/0x40
[   11.799474]  kasan_save_alloc_info+0x3b/0x50
[   11.799785]  __kasan_slab_alloc+0x91/0xa0
[   11.800050]  kmem_cache_alloc_noprof+0x123/0x3f0
[   11.800283]  kmem_cache_rcu_uaf+0x155/0x510
[   11.800457]  kunit_try_run_case+0x1a5/0x480
[   11.800595]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.801044]  kthread+0x337/0x6f0
[   11.801259]  ret_from_fork+0x41/0x80
[   11.801408]  ret_from_fork_asm+0x1a/0x30
[   11.801636] 
[   11.801730] Freed by task 0:
[   11.801958]  kasan_save_stack+0x45/0x70
[   11.802196]  kasan_save_track+0x18/0x40
[   11.802398]  kasan_save_free_info+0x3f/0x60
[   11.802637]  __kasan_slab_free+0x56/0x70
[   11.802854]  slab_free_after_rcu_debug+0xe4/0x310
[   11.803108]  rcu_core+0x66c/0x1c30
[   11.803374]  rcu_core_si+0x12/0x20
[   11.803697]  handle_softirqs+0x209/0x730
[   11.803900]  __irq_exit_rcu+0xc9/0x110
[   11.804124]  irq_exit_rcu+0x12/0x20
[   11.804334]  sysvec_apic_timer_interrupt+0x81/0x90
[   11.804487]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   11.804666] 
[   11.804759] Last potentially related work creation:
[   11.805211]  kasan_save_stack+0x45/0x70
[   11.805405]  kasan_record_aux_stack+0xb2/0xc0
[   11.805620]  kmem_cache_free+0x131/0x420
[   11.806343]  kmem_cache_rcu_uaf+0x194/0x510
[   11.806493]  kunit_try_run_case+0x1a5/0x480
[   11.806631]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.806800]  kthread+0x337/0x6f0
[   11.807198]  ret_from_fork+0x41/0x80
[   11.807408]  ret_from_fork_asm+0x1a/0x30
[   11.807605] 
[   11.807693] The buggy address belongs to the object at ffff888102f40000
[   11.807693]  which belongs to the cache test_cache of size 200
[   11.808378] The buggy address is located 0 bytes inside of
[   11.808378]  freed 200-byte region [ffff888102f40000, ffff888102f400c8)
[   11.809006] 
[   11.809123] The buggy address belongs to the physical page:
[   11.809395] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102f40
[   11.809631] flags: 0x200000000000000(node=0|zone=2)
[   11.809792] page_type: f5(slab)
[   11.809924] raw: 0200000000000000 ffff8881011f7280 dead000000000122 0000000000000000
[   11.810247] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   11.810941] page dumped because: kasan: bad access detected
[   11.811346] 
[   11.811536] Memory state around the buggy address:
[   11.811871]  ffff888102f3ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.812736]  ffff888102f3ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.813120] >ffff888102f40000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   11.813541]                    ^
[   11.813782]  ffff888102f40080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   11.814191]  ffff888102f40100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.814574] ==================================================================