Date
Feb. 5, 2025, 2:09 p.m.
Environment | |
---|---|
qemu-x86_64 |
[ 50.226141] ================================================================== [ 50.227131] BUG: KASAN: slab-use-after-free in strchr+0x18/0x60 [ 50.227825] Read of size 1 at addr ffff8881028cedd0 by task kunit_try_catch/222 [ 50.228475] [ 50.229902] CPU: 1 PID: 222 Comm: kunit_try_catch Tainted: G B N 6.6.76-rc1 #1 [ 50.231280] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 50.231941] Call Trace: [ 50.232272] <TASK> [ 50.233333] dump_stack_lvl+0x4e/0x90 [ 50.234045] print_report+0xd2/0x660 [ 50.234613] ? __virt_addr_valid+0x156/0x1e0 [ 50.235474] ? kasan_complete_mode_report_info+0x64/0x200 [ 50.236334] kasan_report+0xff/0x140 [ 50.236814] ? strchr+0x18/0x60 [ 50.237543] ? strchr+0x18/0x60 [ 50.237958] __asan_load1+0x66/0x70 [ 50.238572] strchr+0x18/0x60 [ 50.239169] kasan_strings+0xdf/0x510 [ 50.240011] ? __pfx_kasan_strings+0x10/0x10 [ 50.240617] ? __schedule+0x70b/0x1190 [ 50.241359] ? ktime_get_ts64+0x118/0x140 [ 50.242098] kunit_try_run_case+0x126/0x290 [ 50.243037] ? __pfx_kunit_try_run_case+0x10/0x10 [ 50.243595] ? __kasan_check_write+0x18/0x20 [ 50.244476] ? trace_preempt_on+0x20/0xa0 [ 50.245203] ? __kthread_parkme+0x4f/0xd0 [ 50.245763] ? preempt_count_sub+0x50/0x80 [ 50.246362] ? __pfx_kunit_try_run_case+0x10/0x10 [ 50.247065] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 50.247972] kunit_generic_run_threadfn_adapter+0x33/0x50 [ 50.249077] kthread+0x19e/0x1e0 [ 50.249633] ? __pfx_kthread+0x10/0x10 [ 50.250404] ret_from_fork+0x41/0x70 [ 50.251171] ? __pfx_kthread+0x10/0x10 [ 50.251904] ret_from_fork_asm+0x1b/0x30 [ 50.252576] </TASK> [ 50.252904] [ 50.253660] Allocated by task 222: [ 50.254349] kasan_save_stack+0x3c/0x60 [ 50.255129] kasan_set_track+0x29/0x40 [ 50.255614] kasan_save_alloc_info+0x22/0x30 [ 50.256328] __kasan_kmalloc+0xb7/0xc0 [ 50.256923] kmalloc_trace+0x4c/0xb0 [ 50.257706] kasan_strings+0x9f/0x510 [ 50.258810] kunit_try_run_case+0x126/0x290 [ 50.259626] kunit_generic_run_threadfn_adapter+0x33/0x50 [ 50.260543] kthread+0x19e/0x1e0 [ 50.261119] ret_from_fork+0x41/0x70 [ 50.262364] ret_from_fork_asm+0x1b/0x30 [ 50.263053] [ 50.263361] Freed by task 222: [ 50.264243] kasan_save_stack+0x3c/0x60 [ 50.264960] kasan_set_track+0x29/0x40 [ 50.265438] kasan_save_free_info+0x2f/0x50 [ 50.266374] ____kasan_slab_free+0x172/0x1d0 [ 50.266869] __kasan_slab_free+0x16/0x20 [ 50.267509] __kmem_cache_free+0x190/0x310 [ 50.268110] kfree+0x7c/0x120 [ 50.268569] kasan_strings+0xc3/0x510 [ 50.269034] kunit_try_run_case+0x126/0x290 [ 50.269619] kunit_generic_run_threadfn_adapter+0x33/0x50 [ 50.271392] kthread+0x19e/0x1e0 [ 50.271797] ret_from_fork+0x41/0x70 [ 50.272322] ret_from_fork_asm+0x1b/0x30 [ 50.272906] [ 50.273315] The buggy address belongs to the object at ffff8881028cedc0 [ 50.273315] which belongs to the cache kmalloc-32 of size 32 [ 50.274576] The buggy address is located 16 bytes inside of [ 50.274576] freed 32-byte region [ffff8881028cedc0, ffff8881028cede0) [ 50.276530] [ 50.276847] The buggy address belongs to the physical page: [ 50.277340] page:(____ptrval____) refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1028ce [ 50.278661] flags: 0x200000000000800(slab|node=0|zone=2) [ 50.279404] page_type: 0xffffffff() [ 50.280467] raw: 0200000000000800 ffff888100041500 dead000000000122 0000000000000000 [ 50.281268] raw: 0000000000000000 0000000080400040 00000001ffffffff 0000000000000000 [ 50.282068] page dumped because: kasan: bad access detected [ 50.282446] [ 50.282710] Memory state around the buggy address: [ 50.283473] ffff8881028cec80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 50.284534] ffff8881028ced00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 50.285459] >ffff8881028ced80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc [ 50.286213] ^ [ 50.286803] ffff8881028cee00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 50.287671] ffff8881028cee80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 50.288580] ==================================================================