Date
June 7, 2025, 10:40 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 22.080160] ================================================================== [ 22.081157] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70 [ 22.081907] Read of size 4 at addr fff00000c4227280 by task swapper/1/0 [ 22.082569] [ 22.082942] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G B N 6.12.33-rc1 #1 [ 22.083173] Tainted: [B]=BAD_PAGE, [N]=TEST [ 22.083251] Hardware name: linux,dummy-virt (DT) [ 22.083340] Call trace: [ 22.083425] dump_backtrace+0x9c/0x128 [ 22.083543] show_stack+0x20/0x38 [ 22.083651] dump_stack_lvl+0x8c/0xd0 [ 22.083777] print_report+0x118/0x5f0 [ 22.083888] kasan_report+0xdc/0x128 [ 22.084050] __asan_report_load4_noabort+0x20/0x30 [ 22.084172] rcu_uaf_reclaim+0x64/0x70 [ 22.084288] rcu_core+0xa54/0x1df8 [ 22.084408] rcu_core_si+0x18/0x30 [ 22.084511] handle_softirqs+0x36c/0xb18 [ 22.084656] __do_softirq+0x1c/0x28 [ 22.084752] ____do_softirq+0x18/0x30 [ 22.084859] call_on_irq_stack+0x24/0x58 [ 22.084952] do_softirq_own_stack+0x24/0x38 [ 22.085070] irq_exit_rcu+0x1a4/0x268 [ 22.085163] el1_interrupt+0x38/0x58 [ 22.085268] el1h_64_irq_handler+0x18/0x28 [ 22.085346] el1h_64_irq+0x64/0x68 [ 22.085388] arch_local_irq_enable+0x4/0x8 [ 22.085443] do_idle+0x388/0x4f0 [ 22.085485] cpu_startup_entry+0x64/0x80 [ 22.085531] secondary_start_kernel+0x288/0x340 [ 22.085584] __secondary_switched+0xb8/0xc0 [ 22.085640] [ 22.098790] Allocated by task 186: [ 22.099333] kasan_save_stack+0x3c/0x68 [ 22.100107] kasan_save_track+0x20/0x40 [ 22.100676] kasan_save_alloc_info+0x40/0x58 [ 22.101279] __kasan_kmalloc+0xd4/0xd8 [ 22.101862] __kmalloc_cache_noprof+0x154/0x320 [ 22.102537] rcu_uaf+0xb8/0x2e0 [ 22.102928] kunit_try_run_case+0x170/0x3f0 [ 22.103421] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 22.104720] kthread+0x24c/0x2d0 [ 22.105545] ret_from_fork+0x10/0x20 [ 22.106033] [ 22.106566] Freed by task 0: [ 22.107385] kasan_save_stack+0x3c/0x68 [ 22.108059] kasan_save_track+0x20/0x40 [ 22.108723] kasan_save_free_info+0x4c/0x78 [ 22.109448] __kasan_slab_free+0x6c/0x98 [ 22.109950] kfree+0x110/0x3b8 [ 22.110648] rcu_uaf_reclaim+0x28/0x70 [ 22.111159] rcu_core+0xa54/0x1df8 [ 22.111909] rcu_core_si+0x18/0x30 [ 22.112478] handle_softirqs+0x36c/0xb18 [ 22.113044] __do_softirq+0x1c/0x28 [ 22.113585] [ 22.113995] Last potentially related work creation: [ 22.114609] kasan_save_stack+0x3c/0x68 [ 22.115152] __kasan_record_aux_stack+0xbc/0xe8 [ 22.116033] kasan_record_aux_stack_noalloc+0x14/0x20 [ 22.116646] __call_rcu_common.constprop.0+0x74/0xa18 [ 22.117296] call_rcu+0x18/0x30 [ 22.117785] rcu_uaf+0x150/0x2e0 [ 22.118311] kunit_try_run_case+0x170/0x3f0 [ 22.118899] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 22.119558] kthread+0x24c/0x2d0 [ 22.120209] ret_from_fork+0x10/0x20 [ 22.120670] [ 22.121028] The buggy address belongs to the object at fff00000c4227280 [ 22.121028] which belongs to the cache kmalloc-32 of size 32 [ 22.122123] The buggy address is located 0 bytes inside of [ 22.122123] freed 32-byte region [fff00000c4227280, fff00000c42272a0) [ 22.123227] [ 22.123568] The buggy address belongs to the physical page: [ 22.125182] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104227 [ 22.126012] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 22.126699] page_type: f5(slab) [ 22.127284] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000 [ 22.128298] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000 [ 22.129050] page dumped because: kasan: bad access detected [ 22.129644] [ 22.129920] Memory state around the buggy address: [ 22.130497] fff00000c4227180: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 22.131279] fff00000c4227200: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc [ 22.132259] >fff00000c4227280: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc [ 22.132930] ^ [ 22.133415] fff00000c4227300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 22.134137] fff00000c4227380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 22.134908] ==================================================================
[ 18.604689] ================================================================== [ 18.605421] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60 [ 18.606606] Read of size 4 at addr ffff88810230cdc0 by task swapper/1/0 [ 18.607417] [ 18.608097] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G B N 6.12.33-rc1 #1 [ 18.608212] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.608268] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 18.608329] Call Trace: [ 18.608406] <IRQ> [ 18.608486] dump_stack_lvl+0x73/0xb0 [ 18.608581] print_report+0xd1/0x640 [ 18.608660] ? __virt_addr_valid+0x1db/0x2d0 [ 18.608745] ? rcu_uaf_reclaim+0x50/0x60 [ 18.608813] ? kasan_complete_mode_report_info+0x64/0x200 [ 18.608884] ? rcu_uaf_reclaim+0x50/0x60 [ 18.608953] kasan_report+0x140/0x180 [ 18.609029] ? rcu_uaf_reclaim+0x50/0x60 [ 18.609108] __asan_report_load4_noabort+0x18/0x20 [ 18.609183] rcu_uaf_reclaim+0x50/0x60 [ 18.609261] rcu_core+0x683/0x1c80 [ 18.609303] ? __pfx_rcu_core+0x10/0x10 [ 18.609333] ? lapic_next_event+0x19/0x30 [ 18.609359] ? handle_softirqs+0x18e/0x730 [ 18.609395] rcu_core_si+0x12/0x20 [ 18.609421] handle_softirqs+0x209/0x730 [ 18.609483] ? __pfx_handle_softirqs+0x10/0x10 [ 18.609559] irq_exit_rcu+0x9c/0xd0 [ 18.609590] sysvec_apic_timer_interrupt+0x81/0x90 [ 18.609625] </IRQ> [ 18.609665] <TASK> [ 18.609680] asm_sysvec_apic_timer_interrupt+0x1f/0x30 [ 18.609858] RIP: 0010:pv_native_safe_halt+0xf/0x20 [ 18.609986] 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 83 2b 3b 00 fb f4 <c3> cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90 [ 18.610092] RSP: 0000:ffff888100877dd0 EFLAGS: 00010212 [ 18.610206] RAX: ffff88815b100000 RBX: ffff888100844ec0 RCX: ffffffff86cd4d75 [ 18.610301] RDX: ffffed102b626b2b RSI: 0000000000000004 RDI: 0000000000020a9c [ 18.610360] RBP: ffff888100877dd8 R08: 0000000000000001 R09: ffffed102b626b2a [ 18.610417] R10: ffff88815b135953 R11: 000000000003b800 R12: 0000000000000001 [ 18.610880] R13: ffffed10201089d8 R14: ffffffff88b54e08 R15: 0000000000000000 [ 18.610969] ? ct_kernel_exit.constprop.0+0xa5/0xd0 [ 18.611044] ? default_idle+0xd/0x20 [ 18.611078] arch_cpu_idle+0xd/0x20 [ 18.611109] default_idle_call+0x48/0x80 [ 18.611139] do_idle+0x313/0x3c0 [ 18.611174] ? __pfx_do_idle+0x10/0x10 [ 18.611211] cpu_startup_entry+0x5c/0x70 [ 18.611280] start_secondary+0x216/0x290 [ 18.611308] ? __pfx_start_secondary+0x10/0x10 [ 18.611340] common_startup_64+0x12c/0x138 [ 18.611381] </TASK> [ 18.611395] [ 18.636140] Allocated by task 203: [ 18.636862] kasan_save_stack+0x45/0x70 [ 18.637329] kasan_save_track+0x18/0x40 [ 18.637958] kasan_save_alloc_info+0x3b/0x50 [ 18.638781] __kasan_kmalloc+0xb7/0xc0 [ 18.639332] __kmalloc_cache_noprof+0x168/0x350 [ 18.640011] rcu_uaf+0xb1/0x330 [ 18.640585] kunit_try_run_case+0x1a6/0x480 [ 18.641140] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.641858] kthread+0x257/0x310 [ 18.642284] ret_from_fork+0x41/0x80 [ 18.642859] ret_from_fork_asm+0x1a/0x30 [ 18.643382] [ 18.644044] Freed by task 0: [ 18.644654] kasan_save_stack+0x45/0x70 [ 18.645134] kasan_save_track+0x18/0x40 [ 18.645867] kasan_save_free_info+0x3f/0x60 [ 18.646314] __kasan_slab_free+0x56/0x70 [ 18.646781] kfree+0x123/0x3d0 [ 18.647157] rcu_uaf_reclaim+0x1f/0x60 [ 18.648123] rcu_core+0x683/0x1c80 [ 18.648897] rcu_core_si+0x12/0x20 [ 18.649684] handle_softirqs+0x209/0x730 [ 18.650297] irq_exit_rcu+0x9c/0xd0 [ 18.650824] sysvec_apic_timer_interrupt+0x81/0x90 [ 18.651290] asm_sysvec_apic_timer_interrupt+0x1f/0x30 [ 18.651778] [ 18.652311] Last potentially related work creation: [ 18.653018] kasan_save_stack+0x45/0x70 [ 18.653500] __kasan_record_aux_stack+0xae/0xc0 [ 18.654313] kasan_record_aux_stack_noalloc+0xf/0x20 [ 18.654875] __call_rcu_common.constprop.0+0x72/0xaa0 [ 18.655461] call_rcu+0x12/0x20 [ 18.656044] rcu_uaf+0x169/0x330 [ 18.656397] kunit_try_run_case+0x1a6/0x480 [ 18.656941] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.657762] kthread+0x257/0x310 [ 18.658200] ret_from_fork+0x41/0x80 [ 18.658892] ret_from_fork_asm+0x1a/0x30 [ 18.659234] [ 18.659754] The buggy address belongs to the object at ffff88810230cdc0 [ 18.659754] which belongs to the cache kmalloc-32 of size 32 [ 18.661385] The buggy address is located 0 bytes inside of [ 18.661385] freed 32-byte region [ffff88810230cdc0, ffff88810230cde0) [ 18.662486] [ 18.663024] The buggy address belongs to the physical page: [ 18.663876] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10230c [ 18.665267] flags: 0x200000000000000(node=0|zone=2) [ 18.666018] page_type: f5(slab) [ 18.667038] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 18.668031] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000 [ 18.669195] page dumped because: kasan: bad access detected [ 18.669953] [ 18.670260] Memory state around the buggy address: [ 18.670882] ffff88810230cc80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 18.672136] ffff88810230cd00: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc [ 18.673500] >ffff88810230cd80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc [ 18.673896] ^ [ 18.674093] ffff88810230ce00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.674351] ffff88810230ce80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.674578] ==================================================================