Date
July 8, 2025, 11:09 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 19.542208] ================================================================== [ 19.542267] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 19.542318] Read of size 1 at addr fff00000c771c328 by task kunit_try_catch/188 [ 19.542640] [ 19.542897] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT [ 19.543373] Tainted: [B]=BAD_PAGE, [N]=TEST [ 19.543474] Hardware name: linux,dummy-virt (DT) [ 19.543563] Call trace: [ 19.543585] show_stack+0x20/0x38 (C) [ 19.543639] dump_stack_lvl+0x8c/0xd0 [ 19.544033] print_report+0x118/0x608 [ 19.544114] kasan_report+0xdc/0x128 [ 19.544196] __asan_report_load1_noabort+0x20/0x30 [ 19.544253] kmalloc_uaf2+0x3f4/0x468 [ 19.544298] kunit_try_run_case+0x170/0x3f0 [ 19.544346] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.544528] kthread+0x328/0x630 [ 19.544635] ret_from_fork+0x10/0x20 [ 19.544786] [ 19.544842] Allocated by task 188: [ 19.544909] kasan_save_stack+0x3c/0x68 [ 19.544951] kasan_save_track+0x20/0x40 [ 19.544989] kasan_save_alloc_info+0x40/0x58 [ 19.545052] __kasan_kmalloc+0xd4/0xd8 [ 19.545090] __kmalloc_cache_noprof+0x16c/0x3c0 [ 19.545131] kmalloc_uaf2+0xc4/0x468 [ 19.545177] kunit_try_run_case+0x170/0x3f0 [ 19.545218] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.545261] kthread+0x328/0x630 [ 19.545347] ret_from_fork+0x10/0x20 [ 19.545500] [ 19.545540] Freed by task 188: [ 19.545702] kasan_save_stack+0x3c/0x68 [ 19.545754] kasan_save_track+0x20/0x40 [ 19.545791] kasan_save_free_info+0x4c/0x78 [ 19.545939] __kasan_slab_free+0x6c/0x98 [ 19.545978] kfree+0x214/0x3c8 [ 19.546014] kmalloc_uaf2+0x134/0x468 [ 19.546048] kunit_try_run_case+0x170/0x3f0 [ 19.546097] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.546239] kthread+0x328/0x630 [ 19.546312] ret_from_fork+0x10/0x20 [ 19.546386] [ 19.546434] The buggy address belongs to the object at fff00000c771c300 [ 19.546434] which belongs to the cache kmalloc-64 of size 64 [ 19.546521] The buggy address is located 40 bytes inside of [ 19.546521] freed 64-byte region [fff00000c771c300, fff00000c771c340) [ 19.546693] [ 19.546786] The buggy address belongs to the physical page: [ 19.546844] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10771c [ 19.546960] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 19.547043] page_type: f5(slab) [ 19.547141] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 19.547202] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 19.547242] page dumped because: kasan: bad access detected [ 19.547273] [ 19.547290] Memory state around the buggy address: [ 19.547321] fff00000c771c200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 19.547365] fff00000c771c280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 19.547434] >fff00000c771c300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 19.547473] ^ [ 19.547525] fff00000c771c380: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 19.547569] fff00000c771c400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 19.547608] ==================================================================
[ 12.817802] ================================================================== [ 12.819177] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 12.819419] Read of size 1 at addr ffff888102b88528 by task kunit_try_catch/206 [ 12.819677] [ 12.819771] CPU: 0 UID: 0 PID: 206 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT(voluntary) [ 12.819819] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.819830] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.819851] Call Trace: [ 12.819863] <TASK> [ 12.819901] dump_stack_lvl+0x73/0xb0 [ 12.819935] print_report+0xd1/0x650 [ 12.819971] ? __virt_addr_valid+0x1db/0x2d0 [ 12.820103] ? kmalloc_uaf2+0x4a8/0x520 [ 12.820124] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.820147] ? kmalloc_uaf2+0x4a8/0x520 [ 12.820167] kasan_report+0x141/0x180 [ 12.820189] ? kmalloc_uaf2+0x4a8/0x520 [ 12.820214] __asan_report_load1_noabort+0x18/0x20 [ 12.820238] kmalloc_uaf2+0x4a8/0x520 [ 12.820257] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 12.820277] ? finish_task_switch.isra.0+0x153/0x700 [ 12.820301] ? __switch_to+0x47/0xf50 [ 12.820327] ? __schedule+0x10cc/0x2b60 [ 12.820349] ? __pfx_read_tsc+0x10/0x10 [ 12.820380] ? ktime_get_ts64+0x86/0x230 [ 12.820405] kunit_try_run_case+0x1a5/0x480 [ 12.820430] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.820463] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.820488] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.820520] ? __kthread_parkme+0x82/0x180 [ 12.820541] ? preempt_count_sub+0x50/0x80 [ 12.820563] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.820606] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.820631] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.820655] kthread+0x337/0x6f0 [ 12.820673] ? trace_preempt_on+0x20/0xc0 [ 12.820697] ? __pfx_kthread+0x10/0x10 [ 12.820717] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.820738] ? calculate_sigpending+0x7b/0xa0 [ 12.820763] ? __pfx_kthread+0x10/0x10 [ 12.820784] ret_from_fork+0x116/0x1d0 [ 12.820801] ? __pfx_kthread+0x10/0x10 [ 12.820821] ret_from_fork_asm+0x1a/0x30 [ 12.820853] </TASK> [ 12.820864] [ 12.829086] Allocated by task 206: [ 12.829377] kasan_save_stack+0x45/0x70 [ 12.829634] kasan_save_track+0x18/0x40 [ 12.829831] kasan_save_alloc_info+0x3b/0x50 [ 12.830023] __kasan_kmalloc+0xb7/0xc0 [ 12.830155] __kmalloc_cache_noprof+0x189/0x420 [ 12.830416] kmalloc_uaf2+0xc6/0x520 [ 12.830627] kunit_try_run_case+0x1a5/0x480 [ 12.830834] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.831011] kthread+0x337/0x6f0 [ 12.831242] ret_from_fork+0x116/0x1d0 [ 12.831439] ret_from_fork_asm+0x1a/0x30 [ 12.831678] [ 12.831785] Freed by task 206: [ 12.831916] kasan_save_stack+0x45/0x70 [ 12.832121] kasan_save_track+0x18/0x40 [ 12.832269] kasan_save_free_info+0x3f/0x60 [ 12.832481] __kasan_slab_free+0x56/0x70 [ 12.832761] kfree+0x222/0x3f0 [ 12.833086] kmalloc_uaf2+0x14c/0x520 [ 12.833306] kunit_try_run_case+0x1a5/0x480 [ 12.833517] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.833770] kthread+0x337/0x6f0 [ 12.833993] ret_from_fork+0x116/0x1d0 [ 12.834177] ret_from_fork_asm+0x1a/0x30 [ 12.834373] [ 12.834488] The buggy address belongs to the object at ffff888102b88500 [ 12.834488] which belongs to the cache kmalloc-64 of size 64 [ 12.834868] The buggy address is located 40 bytes inside of [ 12.834868] freed 64-byte region [ffff888102b88500, ffff888102b88540) [ 12.835216] [ 12.835323] The buggy address belongs to the physical page: [ 12.835873] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b88 [ 12.836230] flags: 0x200000000000000(node=0|zone=2) [ 12.836622] page_type: f5(slab) [ 12.836794] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 12.837051] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 12.837275] page dumped because: kasan: bad access detected [ 12.837467] [ 12.837786] Memory state around the buggy address: [ 12.838234] ffff888102b88400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.838643] ffff888102b88480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.838935] >ffff888102b88500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.839260] ^ [ 12.839501] ffff888102b88580: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 12.839810] ffff888102b88600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.840215] ==================================================================