Hay
Date
May 12, 2025, 6:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.355431] ==================================================================
[   19.356296] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   19.356831] Read of size 4 at addr fff00000c6549980 by task swapper/0/0
[   19.357438] 
[   19.357770] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N 6.14.7-rc1 #1
[   19.357964] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.358027] Hardware name: linux,dummy-virt (DT)
[   19.358121] Call trace:
[   19.358180]  show_stack+0x20/0x38 (C)
[   19.358309]  dump_stack_lvl+0x8c/0xd0
[   19.358427]  print_report+0x118/0x608
[   19.358806]  kasan_report+0xdc/0x128
[   19.358938]  __asan_report_load4_noabort+0x20/0x30
[   19.359020]  rcu_uaf_reclaim+0x64/0x70
[   19.359072]  rcu_core+0x9f4/0x1e20
[   19.359129]  rcu_core_si+0x18/0x30
[   19.359176]  handle_softirqs+0x374/0xb28
[   19.359229]  __do_softirq+0x1c/0x28
[   19.359276]  ____do_softirq+0x18/0x30
[   19.359325]  call_on_irq_stack+0x24/0x58
[   19.359376]  do_softirq_own_stack+0x24/0x38
[   19.359427]  __irq_exit_rcu+0x1fc/0x318
[   19.359476]  irq_exit_rcu+0x1c/0x80
[   19.359522]  el1_interrupt+0x38/0x58
[   19.359576]  el1h_64_irq_handler+0x18/0x28
[   19.359626]  el1h_64_irq+0x6c/0x70
[   19.359781]  arch_local_irq_enable+0x4/0x8 (P)
[   19.359848]  do_idle+0x384/0x4e8
[   19.359898]  cpu_startup_entry+0x68/0x80
[   19.359947]  rest_init+0x160/0x188
[   19.359996]  start_kernel+0x310/0x3d8
[   19.360053]  __primary_switched+0x8c/0xa0
[   19.360115] 
[   19.369951] Allocated by task 187:
[   19.370439]  kasan_save_stack+0x3c/0x68
[   19.371317]  kasan_save_track+0x20/0x40
[   19.371869]  kasan_save_alloc_info+0x40/0x58
[   19.372414]  __kasan_kmalloc+0xd4/0xd8
[   19.372822]  __kmalloc_cache_noprof+0x15c/0x3c0
[   19.373346]  rcu_uaf+0xb0/0x2d0
[   19.373776]  kunit_try_run_case+0x170/0x3f0
[   19.374246]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.375079]  kthread+0x318/0x620
[   19.375498]  ret_from_fork+0x10/0x20
[   19.376006] 
[   19.376271] Freed by task 0:
[   19.376655]  kasan_save_stack+0x3c/0x68
[   19.377130]  kasan_save_track+0x20/0x40
[   19.377654]  kasan_save_free_info+0x4c/0x78
[   19.378187]  __kasan_slab_free+0x6c/0x98
[   19.378973]  kfree+0x214/0x3c8
[   19.379600]  rcu_uaf_reclaim+0x28/0x70
[   19.380327]  rcu_core+0x9f4/0x1e20
[   19.380768]  rcu_core_si+0x18/0x30
[   19.381272]  handle_softirqs+0x374/0xb28
[   19.381696]  __do_softirq+0x1c/0x28
[   19.382226] 
[   19.382613] Last potentially related work creation:
[   19.383332]  kasan_save_stack+0x3c/0x68
[   19.383856]  kasan_record_aux_stack+0xb4/0xc8
[   19.384345]  __call_rcu_common.constprop.0+0x74/0xa10
[   19.384937]  call_rcu+0x18/0x30
[   19.385353]  rcu_uaf+0x14c/0x2d0
[   19.385791]  kunit_try_run_case+0x170/0x3f0
[   19.386255]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.387115]  kthread+0x318/0x620
[   19.387569]  ret_from_fork+0x10/0x20
[   19.388038] 
[   19.388392] The buggy address belongs to the object at fff00000c6549980
[   19.388392]  which belongs to the cache kmalloc-32 of size 32
[   19.389391] The buggy address is located 0 bytes inside of
[   19.389391]  freed 32-byte region [fff00000c6549980, fff00000c65499a0)
[   19.390419] 
[   19.391005] The buggy address belongs to the physical page:
[   19.391313] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106549
[   19.392192] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.392838] page_type: f5(slab)
[   19.393278] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.394091] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.394894] page dumped because: kasan: bad access detected
[   19.395627] 
[   19.395916] Memory state around the buggy address:
[   19.396480]  fff00000c6549880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.397079]  fff00000c6549900: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.397862] >fff00000c6549980: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   19.398609]                    ^
[   19.399177]  fff00000c6549a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.399687]  fff00000c6549a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.400466] ==================================================================

[   12.980141] ==================================================================
[   12.980720] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   12.980976] Read of size 4 at addr ffff888101b25e40 by task swapper/1/0
[   12.981623] 
[   12.981759] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N 6.14.7-rc1 #1
[   12.981813] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.981825] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.981862] Call Trace:
[   12.981900]  <IRQ>
[   12.981922]  dump_stack_lvl+0x73/0xb0
[   12.981955]  print_report+0xd1/0x650
[   12.981978]  ? __virt_addr_valid+0x1db/0x2d0
[   12.982085]  ? rcu_uaf_reclaim+0x50/0x60
[   12.982107]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.982132]  ? rcu_uaf_reclaim+0x50/0x60
[   12.982151]  kasan_report+0x140/0x180
[   12.982172]  ? rcu_uaf_reclaim+0x50/0x60
[   12.982195]  __asan_report_load4_noabort+0x18/0x20
[   12.982218]  rcu_uaf_reclaim+0x50/0x60
[   12.982237]  rcu_core+0x680/0x1d70
[   12.982267]  ? __pfx_rcu_core+0x10/0x10
[   12.982289]  ? ktime_get+0x6b/0x150
[   12.982311]  ? handle_softirqs+0x18e/0x730
[   12.982337]  rcu_core_si+0x12/0x20
[   12.982357]  handle_softirqs+0x209/0x730
[   12.982378]  ? hrtimer_interrupt+0x2fe/0x780
[   12.982400]  ? __pfx_handle_softirqs+0x10/0x10
[   12.982426]  __irq_exit_rcu+0xc9/0x110
[   12.982447]  irq_exit_rcu+0x12/0x20
[   12.982468]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.982493]  </IRQ>
[   12.982526]  <TASK>
[   12.982536]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.982631] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   12.982758] Code: 1f 84 00 00 00 00 00 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa eb 07 0f 00 2d 33 b2 10 00 fb f4 <e9> cc 1c 02 00 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
[   12.982856] RSP: 0000:ffff88810088fdd0 EFLAGS: 00010216
[   12.982952] RAX: ffff888154b00000 RBX: ffff8881008790c0 RCX: ffffffffa437ce05
[   12.983390] RDX: ffffed102a966ae3 RSI: 0000000000000004 RDI: 000000000000e7dc
[   12.983451] RBP: ffff88810088fdd8 R08: 0000000000000001 R09: ffffed102a966ae2
[   12.983506] R10: ffff888154b35713 R11: 00000000000b5000 R12: 0000000000000001
[   12.983549] R13: ffffed102010f218 R14: ffffffffa5f83210 R15: 0000000000000000
[   12.983613]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   12.983673]  ? default_idle+0xd/0x20
[   12.983693]  arch_cpu_idle+0xd/0x20
[   12.983712]  default_idle_call+0x48/0x80
[   12.983732]  do_idle+0x310/0x3c0
[   12.983752]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.983778]  ? __pfx_do_idle+0x10/0x10
[   12.983795]  ? _raw_spin_unlock_irqrestore+0x49/0x90
[   12.983819]  ? complete+0x15b/0x1d0
[   12.983856]  cpu_startup_entry+0x5c/0x70
[   12.983877]  start_secondary+0x216/0x290
[   12.983899]  ? __pfx_start_secondary+0x10/0x10
[   12.983924]  common_startup_64+0x12c/0x138
[   12.983956]  </TASK>
[   12.983968] 
[   12.994344] Allocated by task 206:
[   12.994508]  kasan_save_stack+0x45/0x70
[   12.994717]  kasan_save_track+0x18/0x40
[   12.994919]  kasan_save_alloc_info+0x3b/0x50
[   12.995369]  __kasan_kmalloc+0xb7/0xc0
[   12.995515]  __kmalloc_cache_noprof+0x18a/0x420
[   12.995674]  rcu_uaf+0xb1/0x330
[   12.995851]  kunit_try_run_case+0x1a6/0x480
[   12.996179]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.996456]  kthread+0x324/0x6e0
[   12.996645]  ret_from_fork+0x41/0x80
[   12.996849]  ret_from_fork_asm+0x1a/0x30
[   12.997099] 
[   12.997174] Freed by task 0:
[   12.997331]  kasan_save_stack+0x45/0x70
[   12.997527]  kasan_save_track+0x18/0x40
[   12.997723]  kasan_save_free_info+0x3f/0x60
[   12.997958]  __kasan_slab_free+0x56/0x70
[   12.998196]  kfree+0x224/0x3f0
[   12.998354]  rcu_uaf_reclaim+0x1f/0x60
[   12.998544]  rcu_core+0x680/0x1d70
[   12.998692]  rcu_core_si+0x12/0x20
[   12.998883]  handle_softirqs+0x209/0x730
[   12.999406]  __irq_exit_rcu+0xc9/0x110
[   12.999616]  irq_exit_rcu+0x12/0x20
[   12.999753]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.999942]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.000283] 
[   13.000420] Last potentially related work creation:
[   13.000658]  kasan_save_stack+0x45/0x70
[   13.000817]  kasan_record_aux_stack+0xb2/0xc0
[   13.001139]  __call_rcu_common.constprop.0+0x72/0xaa0
[   13.001371]  call_rcu+0x12/0x20
[   13.001512]  rcu_uaf+0x169/0x330
[   13.001663]  kunit_try_run_case+0x1a6/0x480
[   13.001882]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.002215]  kthread+0x324/0x6e0
[   13.002381]  ret_from_fork+0x41/0x80
[   13.002542]  ret_from_fork_asm+0x1a/0x30
[   13.002727] 
[   13.002833] The buggy address belongs to the object at ffff888101b25e40
[   13.002833]  which belongs to the cache kmalloc-32 of size 32
[   13.003550] The buggy address is located 0 bytes inside of
[   13.003550]  freed 32-byte region [ffff888101b25e40, ffff888101b25e60)
[   13.004135] 
[   13.004240] The buggy address belongs to the physical page:
[   13.004423] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b25
[   13.004663] flags: 0x200000000000000(node=0|zone=2)
[   13.004872] page_type: f5(slab)
[   13.005155] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.005505] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.005821] page dumped because: kasan: bad access detected
[   13.006090] 
[   13.006165] Memory state around the buggy address:
[   13.006394]  ffff888101b25d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.006719]  ffff888101b25d80: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   13.007338] >ffff888101b25e00: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.007651]                                            ^
[   13.007821]  ffff888101b25e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.008252]  ffff888101b25f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.008575] ==================================================================