Date
July 6, 2025, 11:09 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.176864] ================================================================== [ 18.176973] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338 [ 18.177034] Read of size 1 at addr fff00000c1cea948 by task kunit_try_catch/184 [ 18.177081] [ 18.177117] CPU: 1 UID: 0 PID: 184 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 18.177600] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.177640] Hardware name: linux,dummy-virt (DT) [ 18.177674] Call trace: [ 18.177696] show_stack+0x20/0x38 (C) [ 18.177911] dump_stack_lvl+0x8c/0xd0 [ 18.178252] print_report+0x118/0x608 [ 18.178528] kasan_report+0xdc/0x128 [ 18.178576] __asan_report_load1_noabort+0x20/0x30 [ 18.178628] kmalloc_uaf+0x300/0x338 [ 18.178670] kunit_try_run_case+0x170/0x3f0 [ 18.178718] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.178769] kthread+0x328/0x630 [ 18.178810] ret_from_fork+0x10/0x20 [ 18.178880] [ 18.178899] Allocated by task 184: [ 18.178945] kasan_save_stack+0x3c/0x68 [ 18.178997] kasan_save_track+0x20/0x40 [ 18.179049] kasan_save_alloc_info+0x40/0x58 [ 18.179089] __kasan_kmalloc+0xd4/0xd8 [ 18.179140] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.179181] kmalloc_uaf+0xb8/0x338 [ 18.179237] kunit_try_run_case+0x170/0x3f0 [ 18.179282] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.179325] kthread+0x328/0x630 [ 18.179356] ret_from_fork+0x10/0x20 [ 18.179402] [ 18.179420] Freed by task 184: [ 18.179447] kasan_save_stack+0x3c/0x68 [ 18.179483] kasan_save_track+0x20/0x40 [ 18.179520] kasan_save_free_info+0x4c/0x78 [ 18.179581] __kasan_slab_free+0x6c/0x98 [ 18.179625] kfree+0x214/0x3c8 [ 18.179660] kmalloc_uaf+0x11c/0x338 [ 18.179695] kunit_try_run_case+0x170/0x3f0 [ 18.179736] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.179781] kthread+0x328/0x630 [ 18.179812] ret_from_fork+0x10/0x20 [ 18.179861] [ 18.179890] The buggy address belongs to the object at fff00000c1cea940 [ 18.179890] which belongs to the cache kmalloc-16 of size 16 [ 18.179960] The buggy address is located 8 bytes inside of [ 18.179960] freed 16-byte region [fff00000c1cea940, fff00000c1cea950) [ 18.180030] [ 18.180050] The buggy address belongs to the physical page: [ 18.180096] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101cea [ 18.180158] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.180552] page_type: f5(slab) [ 18.181013] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 18.181099] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 18.181210] page dumped because: kasan: bad access detected [ 18.181276] [ 18.181318] Memory state around the buggy address: [ 18.181746] fff00000c1cea800: fa fb fc fc 00 04 fc fc fa fb fc fc fa fb fc fc [ 18.181979] fff00000c1cea880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.182321] >fff00000c1cea900: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc [ 18.182403] ^ [ 18.182457] fff00000c1cea980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.182791] fff00000c1ceaa00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.182951] ==================================================================
[ 11.830028] ================================================================== [ 11.830509] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380 [ 11.830820] Read of size 1 at addr ffff888101e8f4c8 by task kunit_try_catch/201 [ 11.831114] [ 11.831256] CPU: 0 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 11.831299] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.831311] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.831331] Call Trace: [ 11.831344] <TASK> [ 11.831359] dump_stack_lvl+0x73/0xb0 [ 11.831388] print_report+0xd1/0x650 [ 11.831410] ? __virt_addr_valid+0x1db/0x2d0 [ 11.831432] ? kmalloc_uaf+0x320/0x380 [ 11.831452] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.831473] ? kmalloc_uaf+0x320/0x380 [ 11.831494] kasan_report+0x141/0x180 [ 11.831515] ? kmalloc_uaf+0x320/0x380 [ 11.831539] __asan_report_load1_noabort+0x18/0x20 [ 11.831563] kmalloc_uaf+0x320/0x380 [ 11.831582] ? __pfx_kmalloc_uaf+0x10/0x10 [ 11.831602] ? sysvec_apic_timer_interrupt+0x50/0x90 [ 11.831626] ? trace_hardirqs_on+0x37/0xe0 [ 11.831649] ? __pfx_read_tsc+0x10/0x10 [ 11.831669] ? ktime_get_ts64+0x86/0x230 [ 11.831693] kunit_try_run_case+0x1a5/0x480 [ 11.831716] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.831739] ? queued_spin_lock_slowpath+0x116/0xb40 [ 11.831762] ? __kthread_parkme+0x82/0x180 [ 11.831782] ? preempt_count_sub+0x50/0x80 [ 11.831804] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.831828] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.831849] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.831872] kthread+0x337/0x6f0 [ 11.831891] ? trace_preempt_on+0x20/0xc0 [ 11.831912] ? __pfx_kthread+0x10/0x10 [ 11.831945] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.831966] ? calculate_sigpending+0x7b/0xa0 [ 11.831989] ? __pfx_kthread+0x10/0x10 [ 11.832010] ret_from_fork+0x116/0x1d0 [ 11.832028] ? __pfx_kthread+0x10/0x10 [ 11.832048] ret_from_fork_asm+0x1a/0x30 [ 11.832078] </TASK> [ 11.832089] [ 11.839838] Allocated by task 201: [ 11.840031] kasan_save_stack+0x45/0x70 [ 11.840194] kasan_save_track+0x18/0x40 [ 11.840333] kasan_save_alloc_info+0x3b/0x50 [ 11.840489] __kasan_kmalloc+0xb7/0xc0 [ 11.840675] __kmalloc_cache_noprof+0x189/0x420 [ 11.840902] kmalloc_uaf+0xaa/0x380 [ 11.841162] kunit_try_run_case+0x1a5/0x480 [ 11.841362] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.841835] kthread+0x337/0x6f0 [ 11.842011] ret_from_fork+0x116/0x1d0 [ 11.842212] ret_from_fork_asm+0x1a/0x30 [ 11.842351] [ 11.842423] Freed by task 201: [ 11.842534] kasan_save_stack+0x45/0x70 [ 11.842703] kasan_save_track+0x18/0x40 [ 11.842970] kasan_save_free_info+0x3f/0x60 [ 11.843465] __kasan_slab_free+0x56/0x70 [ 11.843763] kfree+0x222/0x3f0 [ 11.843910] kmalloc_uaf+0x12c/0x380 [ 11.844078] kunit_try_run_case+0x1a5/0x480 [ 11.844290] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.844649] kthread+0x337/0x6f0 [ 11.844779] ret_from_fork+0x116/0x1d0 [ 11.844910] ret_from_fork_asm+0x1a/0x30 [ 11.845061] [ 11.845134] The buggy address belongs to the object at ffff888101e8f4c0 [ 11.845134] which belongs to the cache kmalloc-16 of size 16 [ 11.845661] The buggy address is located 8 bytes inside of [ 11.845661] freed 16-byte region [ffff888101e8f4c0, ffff888101e8f4d0) [ 11.846213] [ 11.846288] The buggy address belongs to the physical page: [ 11.846459] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101e8f [ 11.846771] flags: 0x200000000000000(node=0|zone=2) [ 11.847020] page_type: f5(slab) [ 11.847353] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 11.847996] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 11.848455] page dumped because: kasan: bad access detected [ 11.848826] [ 11.848912] Memory state around the buggy address: [ 11.849181] ffff888101e8f380: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc [ 11.849463] ffff888101e8f400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 11.849741] >ffff888101e8f480: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc [ 11.849995] ^ [ 11.850168] ffff888101e8f500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.850502] ffff888101e8f580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.850787] ==================================================================