Date
July 6, 2025, 11:09 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 20.511051] ================================================================== [ 20.511257] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88 [ 20.511488] Read of size 1 at addr fff00000c56d5090 by task kunit_try_catch/259 [ 20.511557] [ 20.511694] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 20.511920] Tainted: [B]=BAD_PAGE, [N]=TEST [ 20.511982] Hardware name: linux,dummy-virt (DT) [ 20.512039] Call trace: [ 20.512081] show_stack+0x20/0x38 (C) [ 20.512142] dump_stack_lvl+0x8c/0xd0 [ 20.512237] print_report+0x118/0x608 [ 20.512297] kasan_report+0xdc/0x128 [ 20.512345] __asan_report_load1_noabort+0x20/0x30 [ 20.512403] strnlen+0x80/0x88 [ 20.512462] kasan_strings+0x478/0xb00 [ 20.512509] kunit_try_run_case+0x170/0x3f0 [ 20.512566] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.512620] kthread+0x328/0x630 [ 20.512671] ret_from_fork+0x10/0x20 [ 20.512726] [ 20.512747] Allocated by task 259: [ 20.512786] kasan_save_stack+0x3c/0x68 [ 20.512832] kasan_save_track+0x20/0x40 [ 20.512872] kasan_save_alloc_info+0x40/0x58 [ 20.512915] __kasan_kmalloc+0xd4/0xd8 [ 20.512952] __kmalloc_cache_noprof+0x16c/0x3c0 [ 20.512993] kasan_strings+0xc8/0xb00 [ 20.513029] kunit_try_run_case+0x170/0x3f0 [ 20.513069] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.513113] kthread+0x328/0x630 [ 20.513158] ret_from_fork+0x10/0x20 [ 20.513206] [ 20.513351] Freed by task 259: [ 20.513689] kasan_save_stack+0x3c/0x68 [ 20.513753] kasan_save_track+0x20/0x40 [ 20.513795] kasan_save_free_info+0x4c/0x78 [ 20.514268] __kasan_slab_free+0x6c/0x98 [ 20.514659] kfree+0x214/0x3c8 [ 20.514746] kasan_strings+0x24c/0xb00 [ 20.514930] kunit_try_run_case+0x170/0x3f0 [ 20.515102] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.515188] kthread+0x328/0x630 [ 20.515580] ret_from_fork+0x10/0x20 [ 20.515659] [ 20.515853] The buggy address belongs to the object at fff00000c56d5080 [ 20.515853] which belongs to the cache kmalloc-32 of size 32 [ 20.516051] The buggy address is located 16 bytes inside of [ 20.516051] freed 32-byte region [fff00000c56d5080, fff00000c56d50a0) [ 20.516152] [ 20.516291] The buggy address belongs to the physical page: [ 20.516439] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056d5 [ 20.516500] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 20.516798] page_type: f5(slab) [ 20.516858] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000 [ 20.516969] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 20.517070] page dumped because: kasan: bad access detected [ 20.517399] [ 20.517457] Memory state around the buggy address: [ 20.517502] fff00000c56d4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 20.517814] fff00000c56d5000: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc [ 20.517887] >fff00000c56d5080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 20.518077] ^ [ 20.518185] fff00000c56d5100: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 20.518340] fff00000c56d5180: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 20.518467] ==================================================================
[ 13.621848] ================================================================== [ 13.622265] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80 [ 13.622957] Read of size 1 at addr ffff8881027a7e10 by task kunit_try_catch/276 [ 13.623420] [ 13.623697] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 13.623745] Tainted: [B]=BAD_PAGE, [N]=TEST [ 13.623758] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 13.623781] Call Trace: [ 13.623798] <TASK> [ 13.623901] dump_stack_lvl+0x73/0xb0 [ 13.623945] print_report+0xd1/0x650 [ 13.623970] ? __virt_addr_valid+0x1db/0x2d0 [ 13.623991] ? strnlen+0x73/0x80 [ 13.624009] ? kasan_complete_mode_report_info+0x64/0x200 [ 13.624032] ? strnlen+0x73/0x80 [ 13.624050] kasan_report+0x141/0x180 [ 13.624072] ? strnlen+0x73/0x80 [ 13.624095] __asan_report_load1_noabort+0x18/0x20 [ 13.624121] strnlen+0x73/0x80 [ 13.624139] kasan_strings+0x615/0xe80 [ 13.624161] ? trace_hardirqs_on+0x37/0xe0 [ 13.624185] ? __pfx_kasan_strings+0x10/0x10 [ 13.624207] ? finish_task_switch.isra.0+0x153/0x700 [ 13.624229] ? __switch_to+0x47/0xf50 [ 13.624254] ? __schedule+0x10cc/0x2b60 [ 13.624276] ? __pfx_read_tsc+0x10/0x10 [ 13.624296] ? ktime_get_ts64+0x86/0x230 [ 13.624320] kunit_try_run_case+0x1a5/0x480 [ 13.624344] ? __pfx_kunit_try_run_case+0x10/0x10 [ 13.624366] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 13.624389] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 13.624411] ? __kthread_parkme+0x82/0x180 [ 13.624432] ? preempt_count_sub+0x50/0x80 [ 13.624454] ? __pfx_kunit_try_run_case+0x10/0x10 [ 13.624478] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.624501] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 13.624524] kthread+0x337/0x6f0 [ 13.624544] ? trace_preempt_on+0x20/0xc0 [ 13.624566] ? __pfx_kthread+0x10/0x10 [ 13.624587] ? _raw_spin_unlock_irq+0x47/0x80 [ 13.624608] ? calculate_sigpending+0x7b/0xa0 [ 13.624631] ? __pfx_kthread+0x10/0x10 [ 13.624653] ret_from_fork+0x116/0x1d0 [ 13.624671] ? __pfx_kthread+0x10/0x10 [ 13.624692] ret_from_fork_asm+0x1a/0x30 [ 13.624722] </TASK> [ 13.624734] [ 13.635223] Allocated by task 276: [ 13.635392] kasan_save_stack+0x45/0x70 [ 13.635606] kasan_save_track+0x18/0x40 [ 13.635822] kasan_save_alloc_info+0x3b/0x50 [ 13.636045] __kasan_kmalloc+0xb7/0xc0 [ 13.636225] __kmalloc_cache_noprof+0x189/0x420 [ 13.636398] kasan_strings+0xc0/0xe80 [ 13.636585] kunit_try_run_case+0x1a5/0x480 [ 13.636817] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.637012] kthread+0x337/0x6f0 [ 13.637164] ret_from_fork+0x116/0x1d0 [ 13.637384] ret_from_fork_asm+0x1a/0x30 [ 13.637734] [ 13.637808] Freed by task 276: [ 13.637921] kasan_save_stack+0x45/0x70 [ 13.638194] kasan_save_track+0x18/0x40 [ 13.638401] kasan_save_free_info+0x3f/0x60 [ 13.638606] __kasan_slab_free+0x56/0x70 [ 13.638789] kfree+0x222/0x3f0 [ 13.638985] kasan_strings+0x2aa/0xe80 [ 13.639192] kunit_try_run_case+0x1a5/0x480 [ 13.639409] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.639663] kthread+0x337/0x6f0 [ 13.639829] ret_from_fork+0x116/0x1d0 [ 13.640036] ret_from_fork_asm+0x1a/0x30 [ 13.640221] [ 13.640293] The buggy address belongs to the object at ffff8881027a7e00 [ 13.640293] which belongs to the cache kmalloc-32 of size 32 [ 13.640718] The buggy address is located 16 bytes inside of [ 13.640718] freed 32-byte region [ffff8881027a7e00, ffff8881027a7e20) [ 13.641246] [ 13.641325] The buggy address belongs to the physical page: [ 13.641510] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027a7 [ 13.641876] flags: 0x200000000000000(node=0|zone=2) [ 13.642223] page_type: f5(slab) [ 13.642429] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 13.642727] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000 [ 13.643089] page dumped because: kasan: bad access detected [ 13.643318] [ 13.643433] Memory state around the buggy address: [ 13.643648] ffff8881027a7d00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc [ 13.643976] ffff8881027a7d80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc [ 13.644318] >ffff8881027a7e00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 13.644588] ^ [ 13.644718] ffff8881027a7e80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 13.644997] ffff8881027a7f00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 13.645325] ==================================================================