Hay
Date
April 22, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64
rk3399-rock-pi-4b

[   19.096687] ==================================================================
[   19.096812] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   19.096902] Read of size 1 at addr fff00000c5d5f000 by task kunit_try_catch/215
[   19.096957] 
[   19.097018] CPU: 1 UID: 0 PID: 215 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc3 #1 PREEMPT 
[   19.097111] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.097142] Hardware name: linux,dummy-virt (DT)
[   19.097200] Call trace:
[   19.097232]  show_stack+0x20/0x38 (C)
[   19.097292]  dump_stack_lvl+0x8c/0xd0
[   19.097343]  print_report+0x118/0x608
[   19.097390]  kasan_report+0xdc/0x128
[   19.097436]  __asan_report_load1_noabort+0x20/0x30
[   19.097506]  kmem_cache_rcu_uaf+0x388/0x468
[   19.097611]  kunit_try_run_case+0x170/0x3f0
[   19.097663]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.098065]  kthread+0x328/0x630
[   19.098120]  ret_from_fork+0x10/0x20
[   19.098174] 
[   19.098193] Allocated by task 215:
[   19.098740]  kasan_save_stack+0x3c/0x68
[   19.098821]  kasan_save_track+0x20/0x40
[   19.098863]  kasan_save_alloc_info+0x40/0x58
[   19.098915]  __kasan_slab_alloc+0xa8/0xb0
[   19.098954]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   19.098994]  kmem_cache_rcu_uaf+0x12c/0x468
[   19.099033]  kunit_try_run_case+0x170/0x3f0
[   19.099071]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.099114]  kthread+0x328/0x630
[   19.099150]  ret_from_fork+0x10/0x20
[   19.099185] 
[   19.099207] Freed by task 0:
[   19.099237]  kasan_save_stack+0x3c/0x68
[   19.099274]  kasan_save_track+0x20/0x40
[   19.099321]  kasan_save_free_info+0x4c/0x78
[   19.099359]  __kasan_slab_free+0x6c/0x98
[   19.099393]  slab_free_after_rcu_debug+0xd4/0x2f8
[   19.099432]  rcu_core+0x9f4/0x1e20
[   19.099466]  rcu_core_si+0x18/0x30
[   19.099500]  handle_softirqs+0x374/0xb28
[   19.099548]  __do_softirq+0x1c/0x28
[   19.099585] 
[   19.099606] Last potentially related work creation:
[   19.099633]  kasan_save_stack+0x3c/0x68
[   19.099669]  kasan_record_aux_stack+0xb4/0xc8
[   19.100158]  kmem_cache_free+0x120/0x470
[   19.100227]  kmem_cache_rcu_uaf+0x16c/0x468
[   19.100269]  kunit_try_run_case+0x170/0x3f0
[   19.100309]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.100352]  kthread+0x328/0x630
[   19.100387]  ret_from_fork+0x10/0x20
[   19.100423] 
[   19.100444] The buggy address belongs to the object at fff00000c5d5f000
[   19.100444]  which belongs to the cache test_cache of size 200
[   19.100507] The buggy address is located 0 bytes inside of
[   19.100507]  freed 200-byte region [fff00000c5d5f000, fff00000c5d5f0c8)
[   19.100580] 
[   19.100605] The buggy address belongs to the physical page:
[   19.100636] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105d5f
[   19.100694] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.100754] page_type: f5(slab)
[   19.100798] raw: 0bfffe0000000000 fff00000c1288780 dead000000000122 0000000000000000
[   19.100849] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.100892] page dumped because: kasan: bad access detected
[   19.100923] 
[   19.100940] Memory state around the buggy address:
[   19.100975]  fff00000c5d5ef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.101020]  fff00000c5d5ef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.101323] >fff00000c5d5f000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.101387]                    ^
[   19.101421]  fff00000c5d5f080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   19.101474]  fff00000c5d5f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.101527] ==================================================================

[   19.465857] ==================================================================
[   19.466644] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   19.467958] Read of size 1 at addr ffff88810297c000 by task kunit_try_catch/233
[   19.469092] 
[   19.469291] CPU: 1 UID: 0 PID: 233 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc3 #1 PREEMPT(voluntary) 
[   19.469404] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.469598] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   19.469899] Call Trace:
[   19.469956]  <TASK>
[   19.470015]  dump_stack_lvl+0x73/0xb0
[   19.470110]  print_report+0xd1/0x650
[   19.470187]  ? __virt_addr_valid+0x1db/0x2d0
[   19.470254]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   19.470284]  ? kasan_complete_mode_report_info+0x64/0x200
[   19.470316]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   19.470344]  kasan_report+0x141/0x180
[   19.470375]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   19.470408]  __asan_report_load1_noabort+0x18/0x20
[   19.470445]  kmem_cache_rcu_uaf+0x3e3/0x510
[   19.470562]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   19.470607]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   19.470653]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   19.470686]  kunit_try_run_case+0x1a5/0x480
[   19.470722]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.470751]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   19.470784]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   19.470816]  ? __kthread_parkme+0x82/0x180
[   19.470848]  ? preempt_count_sub+0x50/0x80
[   19.470882]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.470913]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.470943]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   19.470973]  kthread+0x337/0x6f0
[   19.471001]  ? trace_preempt_on+0x20/0xc0
[   19.471036]  ? __pfx_kthread+0x10/0x10
[   19.471066]  ? _raw_spin_unlock_irq+0x47/0x80
[   19.471095]  ? calculate_sigpending+0x7b/0xa0
[   19.471124]  ? __pfx_kthread+0x10/0x10
[   19.471154]  ret_from_fork+0x41/0x80
[   19.471184]  ? __pfx_kthread+0x10/0x10
[   19.471214]  ret_from_fork_asm+0x1a/0x30
[   19.471258]  </TASK>
[   19.471273] 
[   19.489078] Allocated by task 233:
[   19.489694]  kasan_save_stack+0x45/0x70
[   19.490197]  kasan_save_track+0x18/0x40
[   19.490742]  kasan_save_alloc_info+0x3b/0x50
[   19.491230]  __kasan_slab_alloc+0x91/0xa0
[   19.491821]  kmem_cache_alloc_noprof+0x123/0x3f0
[   19.492342]  kmem_cache_rcu_uaf+0x155/0x510
[   19.493184]  kunit_try_run_case+0x1a5/0x480
[   19.493848]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.494324]  kthread+0x337/0x6f0
[   19.494789]  ret_from_fork+0x41/0x80
[   19.495299]  ret_from_fork_asm+0x1a/0x30
[   19.495937] 
[   19.496162] Freed by task 0:
[   19.497002]  kasan_save_stack+0x45/0x70
[   19.497423]  kasan_save_track+0x18/0x40
[   19.498050]  kasan_save_free_info+0x3f/0x60
[   19.498609]  __kasan_slab_free+0x56/0x70
[   19.499060]  slab_free_after_rcu_debug+0xe4/0x310
[   19.499789]  rcu_core+0x66c/0x1c30
[   19.500180]  rcu_core_si+0x12/0x20
[   19.500896]  handle_softirqs+0x209/0x730
[   19.501308]  __irq_exit_rcu+0xc9/0x110
[   19.501957]  irq_exit_rcu+0x12/0x20
[   19.502414]  sysvec_apic_timer_interrupt+0x81/0x90
[   19.503035]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   19.503771] 
[   19.504039] Last potentially related work creation:
[   19.504461]  kasan_save_stack+0x45/0x70
[   19.505217]  kasan_record_aux_stack+0xb2/0xc0
[   19.505880]  kmem_cache_free+0x131/0x420
[   19.506339]  kmem_cache_rcu_uaf+0x194/0x510
[   19.507063]  kunit_try_run_case+0x1a5/0x480
[   19.507257]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.507531]  kthread+0x337/0x6f0
[   19.507987]  ret_from_fork+0x41/0x80
[   19.508983]  ret_from_fork_asm+0x1a/0x30
[   19.509476] 
[   19.509715] The buggy address belongs to the object at ffff88810297c000
[   19.509715]  which belongs to the cache test_cache of size 200
[   19.511222] The buggy address is located 0 bytes inside of
[   19.511222]  freed 200-byte region [ffff88810297c000, ffff88810297c0c8)
[   19.512226] 
[   19.512546] The buggy address belongs to the physical page:
[   19.513686] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10297c
[   19.514382] flags: 0x200000000000000(node=0|zone=2)
[   19.515109] page_type: f5(slab)
[   19.515526] raw: 0200000000000000 ffff888101ad4b40 dead000000000122 0000000000000000
[   19.516579] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.517480] page dumped because: kasan: bad access detected
[   19.518173] 
[   19.518362] Memory state around the buggy address:
[   19.519242]  ffff88810297bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.519853]  ffff88810297bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.520398] >ffff88810297c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.520980]                    ^
[   19.521344]  ffff88810297c080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   19.522125]  ffff88810297c100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.523131] ==================================================================

[   20.634095] ==================================================================
[   20.635244] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   20.635965] Read of size 1 at addr ffff00000c884000 by task kunit_try_catch/271
[   20.636674] 
[   20.636858] CPU: 3 UID: 0 PID: 271 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc3 #1 PREEMPT 
[   20.636938] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.636963] Hardware name: Radxa ROCK Pi 4B (DT)
[   20.636991] Call trace:
[   20.637009]  show_stack+0x20/0x38 (C)
[   20.637062]  dump_stack_lvl+0x8c/0xd0
[   20.637113]  print_report+0x118/0x608
[   20.637163]  kasan_report+0xdc/0x128
[   20.637209]  __asan_report_load1_noabort+0x20/0x30
[   20.637266]  kmem_cache_rcu_uaf+0x388/0x468
[   20.637325]  kunit_try_run_case+0x170/0x3f0
[   20.637382]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.637447]  kthread+0x328/0x630
[   20.637503]  ret_from_fork+0x10/0x20
[   20.637558] 
[   20.643169] Allocated by task 271:
[   20.643506]  kasan_save_stack+0x3c/0x68
[   20.643888]  kasan_save_track+0x20/0x40
[   20.644260]  kasan_save_alloc_info+0x40/0x58
[   20.644675]  __kasan_slab_alloc+0xa8/0xb0
[   20.645061]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   20.645505]  kmem_cache_rcu_uaf+0x12c/0x468
[   20.645914]  kunit_try_run_case+0x170/0x3f0
[   20.646324]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.646848]  kthread+0x328/0x630
[   20.647171]  ret_from_fork+0x10/0x20
[   20.647521] 
[   20.647674] Freed by task 0:
[   20.647954]  kasan_save_stack+0x3c/0x68
[   20.648324]  kasan_save_track+0x20/0x40
[   20.648696]  kasan_save_free_info+0x4c/0x78
[   20.649101]  __kasan_slab_free+0x6c/0x98
[   20.649479]  slab_free_after_rcu_debug+0xd4/0x2f8
[   20.649928]  rcu_core+0x9f4/0x1e20
[   20.650263]  rcu_core_si+0x18/0x30
[   20.650595]  handle_softirqs+0x374/0xb28
[   20.650978]  __do_softirq+0x1c/0x28
[   20.651318] 
[   20.651471] Last potentially related work creation:
[   20.651923]  kasan_save_stack+0x3c/0x68
[   20.652295]  kasan_record_aux_stack+0xb4/0xc8
[   20.652713]  kmem_cache_free+0x120/0x470
[   20.653092]  kmem_cache_rcu_uaf+0x16c/0x468
[   20.653501]  kunit_try_run_case+0x170/0x3f0
[   20.653908]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.654434]  kthread+0x328/0x630
[   20.654758]  ret_from_fork+0x10/0x20
[   20.655108] 
[   20.655261] The buggy address belongs to the object at ffff00000c884000
[   20.655261]  which belongs to the cache test_cache of size 200
[   20.656389] The buggy address is located 0 bytes inside of
[   20.656389]  freed 200-byte region [ffff00000c884000, ffff00000c8840c8)
[   20.657486] 
[   20.657641] The buggy address belongs to the physical page:
[   20.658157] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xc884
[   20.658882] head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   20.659589] flags: 0x3fffe0000000040(head|node=0|zone=0|lastcpupid=0x1ffff)
[   20.660241] page_type: f5(slab)
[   20.660555] raw: 03fffe0000000040 ffff00000ca9e280 dead000000000122 0000000000000000
[   20.661271] raw: 0000000000000000 00000000801f001f 00000000f5000000 0000000000000000
[   20.661986] head: 03fffe0000000040 ffff00000ca9e280 dead000000000122 0000000000000000
[   20.662711] head: 0000000000000000 00000000801f001f 00000000f5000000 0000000000000000
[   20.663435] head: 03fffe0000000001 fffffdffc0322101 00000000ffffffff 00000000ffffffff
[   20.664158] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002
[   20.664873] page dumped because: kasan: bad access detected
[   20.665388] 
[   20.665541] Memory state around the buggy address:
[   20.665990]  ffff00000c883f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   20.666658]  ffff00000c883f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   20.667325] >ffff00000c884000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   20.667986]                    ^
[   20.668297]  ffff00000c884080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   20.668963]  ffff00000c884100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.669625] ==================================================================