Date
July 8, 2025, 7:07 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 19.436627] ================================================================== [ 19.436706] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 19.436771] Read of size 1 at addr fff00000c5709c28 by task kunit_try_catch/188 [ 19.436820] [ 19.436849] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT [ 19.436935] Tainted: [B]=BAD_PAGE, [N]=TEST [ 19.436962] Hardware name: linux,dummy-virt (DT) [ 19.437003] Call trace: [ 19.437026] show_stack+0x20/0x38 (C) [ 19.437083] dump_stack_lvl+0x8c/0xd0 [ 19.437129] print_report+0x118/0x608 [ 19.437179] kasan_report+0xdc/0x128 [ 19.437224] __asan_report_load1_noabort+0x20/0x30 [ 19.437273] kmalloc_uaf2+0x3f4/0x468 [ 19.437316] kunit_try_run_case+0x170/0x3f0 [ 19.437363] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.437422] kthread+0x328/0x630 [ 19.437464] ret_from_fork+0x10/0x20 [ 19.437518] [ 19.437536] Allocated by task 188: [ 19.437565] kasan_save_stack+0x3c/0x68 [ 19.437602] kasan_save_track+0x20/0x40 [ 19.437639] kasan_save_alloc_info+0x40/0x58 [ 19.437677] __kasan_kmalloc+0xd4/0xd8 [ 19.437724] __kmalloc_cache_noprof+0x16c/0x3c0 [ 19.437983] kmalloc_uaf2+0xc4/0x468 [ 19.438035] kunit_try_run_case+0x170/0x3f0 [ 19.438546] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.438615] kthread+0x328/0x630 [ 19.438843] ret_from_fork+0x10/0x20 [ 19.438952] [ 19.438971] Freed by task 188: [ 19.438999] kasan_save_stack+0x3c/0x68 [ 19.439056] kasan_save_track+0x20/0x40 [ 19.439243] kasan_save_free_info+0x4c/0x78 [ 19.439434] __kasan_slab_free+0x6c/0x98 [ 19.439605] kfree+0x214/0x3c8 [ 19.439751] kmalloc_uaf2+0x134/0x468 [ 19.439925] kunit_try_run_case+0x170/0x3f0 [ 19.439976] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.440028] kthread+0x328/0x630 [ 19.440076] ret_from_fork+0x10/0x20 [ 19.440117] [ 19.440136] The buggy address belongs to the object at fff00000c5709c00 [ 19.440136] which belongs to the cache kmalloc-64 of size 64 [ 19.440539] The buggy address is located 40 bytes inside of [ 19.440539] freed 64-byte region [fff00000c5709c00, fff00000c5709c40) [ 19.440653] [ 19.440797] The buggy address belongs to the physical page: [ 19.440881] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105709 [ 19.440976] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 19.441116] page_type: f5(slab) [ 19.441155] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 19.441232] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 19.441416] page dumped because: kasan: bad access detected [ 19.441533] [ 19.441759] Memory state around the buggy address: [ 19.441838] fff00000c5709b00: 00 00 00 00 02 fc fc fc fc fc fc fc fc fc fc fc [ 19.441884] fff00000c5709b80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 19.441970] >fff00000c5709c00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 19.442226] ^ [ 19.442339] fff00000c5709c80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 19.442600] fff00000c5709d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 19.442785] ==================================================================
[ 13.232886] ================================================================== [ 13.233716] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 13.234026] Read of size 1 at addr ffff88810260d3a8 by task kunit_try_catch/205 [ 13.234775] [ 13.234888] CPU: 1 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT(voluntary) [ 13.234935] Tainted: [B]=BAD_PAGE, [N]=TEST [ 13.234947] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 13.235000] Call Trace: [ 13.235012] <TASK> [ 13.235028] dump_stack_lvl+0x73/0xb0 [ 13.235172] print_report+0xd1/0x650 [ 13.235195] ? __virt_addr_valid+0x1db/0x2d0 [ 13.235231] ? kmalloc_uaf2+0x4a8/0x520 [ 13.235250] ? kasan_complete_mode_report_info+0x64/0x200 [ 13.235275] ? kmalloc_uaf2+0x4a8/0x520 [ 13.235294] kasan_report+0x141/0x180 [ 13.235314] ? kmalloc_uaf2+0x4a8/0x520 [ 13.235339] __asan_report_load1_noabort+0x18/0x20 [ 13.235361] kmalloc_uaf2+0x4a8/0x520 [ 13.235380] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 13.235398] ? finish_task_switch.isra.0+0x153/0x700 [ 13.235419] ? __switch_to+0x47/0xf50 [ 13.235446] ? __schedule+0x10cc/0x2b60 [ 13.235467] ? __pfx_read_tsc+0x10/0x10 [ 13.235487] ? ktime_get_ts64+0x86/0x230 [ 13.235518] kunit_try_run_case+0x1a5/0x480 [ 13.235541] ? __pfx_kunit_try_run_case+0x10/0x10 [ 13.235562] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 13.235584] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 13.235606] ? __kthread_parkme+0x82/0x180 [ 13.235625] ? preempt_count_sub+0x50/0x80 [ 13.235647] ? __pfx_kunit_try_run_case+0x10/0x10 [ 13.235669] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.235690] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 13.235711] kthread+0x337/0x6f0 [ 13.235730] ? trace_preempt_on+0x20/0xc0 [ 13.235752] ? __pfx_kthread+0x10/0x10 [ 13.235771] ? _raw_spin_unlock_irq+0x47/0x80 [ 13.235791] ? calculate_sigpending+0x7b/0xa0 [ 13.235814] ? __pfx_kthread+0x10/0x10 [ 13.235834] ret_from_fork+0x116/0x1d0 [ 13.235851] ? __pfx_kthread+0x10/0x10 [ 13.235870] ret_from_fork_asm+0x1a/0x30 [ 13.235900] </TASK> [ 13.235912] [ 13.244832] Allocated by task 205: [ 13.245033] kasan_save_stack+0x45/0x70 [ 13.245418] kasan_save_track+0x18/0x40 [ 13.245648] kasan_save_alloc_info+0x3b/0x50 [ 13.245866] __kasan_kmalloc+0xb7/0xc0 [ 13.246064] __kmalloc_cache_noprof+0x189/0x420 [ 13.246548] kmalloc_uaf2+0xc6/0x520 [ 13.246811] kunit_try_run_case+0x1a5/0x480 [ 13.246960] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.247510] kthread+0x337/0x6f0 [ 13.247716] ret_from_fork+0x116/0x1d0 [ 13.247900] ret_from_fork_asm+0x1a/0x30 [ 13.248121] [ 13.248263] Freed by task 205: [ 13.248376] kasan_save_stack+0x45/0x70 [ 13.248560] kasan_save_track+0x18/0x40 [ 13.248804] kasan_save_free_info+0x3f/0x60 [ 13.249015] __kasan_slab_free+0x56/0x70 [ 13.249343] kfree+0x222/0x3f0 [ 13.249611] kmalloc_uaf2+0x14c/0x520 [ 13.249748] kunit_try_run_case+0x1a5/0x480 [ 13.249893] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.250418] kthread+0x337/0x6f0 [ 13.250648] ret_from_fork+0x116/0x1d0 [ 13.250839] ret_from_fork_asm+0x1a/0x30 [ 13.251121] [ 13.251208] The buggy address belongs to the object at ffff88810260d380 [ 13.251208] which belongs to the cache kmalloc-64 of size 64 [ 13.251790] The buggy address is located 40 bytes inside of [ 13.251790] freed 64-byte region [ffff88810260d380, ffff88810260d3c0) [ 13.252419] [ 13.252526] The buggy address belongs to the physical page: [ 13.252813] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10260d [ 13.253209] flags: 0x200000000000000(node=0|zone=2) [ 13.253486] page_type: f5(slab) [ 13.253859] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 13.254466] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 13.254753] page dumped because: kasan: bad access detected [ 13.254927] [ 13.254997] Memory state around the buggy address: [ 13.255272] ffff88810260d280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 13.255861] ffff88810260d300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 13.256166] >ffff88810260d380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 13.256600] ^ [ 13.256754] ffff88810260d400: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 13.256970] ffff88810260d480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 13.257244] ==================================================================