Date
Nov. 22, 2024, 6:35 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 34.269309] ================================================================== [ 34.271334] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308 [ 34.272287] Read of size 1 at addr fff00000c6105320 by task kunit_try_catch/181 [ 34.273980] [ 34.274568] CPU: 0 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G B N 6.12.0-next-20241122 #1 [ 34.275946] Tainted: [B]=BAD_PAGE, [N]=TEST [ 34.276686] Hardware name: linux,dummy-virt (DT) [ 34.277184] Call trace: [ 34.278416] show_stack+0x20/0x38 (C) [ 34.279094] dump_stack_lvl+0x8c/0xd0 [ 34.279761] print_report+0x118/0x5e0 [ 34.280909] kasan_report+0xc8/0x118 [ 34.281359] __kasan_check_byte+0x54/0x70 [ 34.282099] kfree_sensitive+0x30/0xb0 [ 34.282803] kmalloc_double_kzfree+0x168/0x308 [ 34.283609] kunit_try_run_case+0x14c/0x3d0 [ 34.284367] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 34.285585] kthread+0x24c/0x2d0 [ 34.286357] ret_from_fork+0x10/0x20 [ 34.286828] [ 34.287080] Allocated by task 181: [ 34.287465] kasan_save_stack+0x3c/0x68 [ 34.288848] kasan_save_track+0x20/0x40 [ 34.289657] kasan_save_alloc_info+0x40/0x58 [ 34.290975] __kasan_kmalloc+0xd4/0xd8 [ 34.291732] __kmalloc_cache_noprof+0x15c/0x3c8 [ 34.292733] kmalloc_double_kzfree+0xb8/0x308 [ 34.294411] kunit_try_run_case+0x14c/0x3d0 [ 34.294961] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 34.295910] kthread+0x24c/0x2d0 [ 34.296183] ret_from_fork+0x10/0x20 [ 34.296668] [ 34.297404] Freed by task 181: [ 34.298410] kasan_save_stack+0x3c/0x68 [ 34.299204] kasan_save_track+0x20/0x40 [ 34.299824] kasan_save_free_info+0x4c/0x78 [ 34.300797] __kasan_slab_free+0x6c/0x98 [ 34.301654] kfree+0x114/0x3d0 [ 34.302062] kfree_sensitive+0x80/0xb0 [ 34.302492] kmalloc_double_kzfree+0x11c/0x308 [ 34.303040] kunit_try_run_case+0x14c/0x3d0 [ 34.303670] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 34.304757] kthread+0x24c/0x2d0 [ 34.305690] ret_from_fork+0x10/0x20 [ 34.307139] [ 34.307674] The buggy address belongs to the object at fff00000c6105320 [ 34.307674] which belongs to the cache kmalloc-16 of size 16 [ 34.309109] The buggy address is located 0 bytes inside of [ 34.309109] freed 16-byte region [fff00000c6105320, fff00000c6105330) [ 34.310417] [ 34.310954] The buggy address belongs to the physical page: [ 34.313126] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106105 [ 34.314576] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 34.315725] page_type: f5(slab) [ 34.316134] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 34.318621] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000 [ 34.319855] page dumped because: kasan: bad access detected [ 34.321172] [ 34.321605] Memory state around the buggy address: [ 34.322083] fff00000c6105200: 00 06 fc fc 00 06 fc fc 00 00 fc fc fa fb fc fc [ 34.323422] fff00000c6105280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 34.324587] >fff00000c6105300: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 34.325948] ^ [ 34.326607] fff00000c6105380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 34.327459] fff00000c6105400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 34.328803] ==================================================================
[ 25.625369] ================================================================== [ 25.626487] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19d/0x360 [ 25.627602] Read of size 1 at addr ffff8881028346c0 by task kunit_try_catch/200 [ 25.628602] [ 25.628846] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G B N 6.12.0-next-20241122 #1 [ 25.629620] Tainted: [B]=BAD_PAGE, [N]=TEST [ 25.630406] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 25.631162] Call Trace: [ 25.631800] <TASK> [ 25.632088] dump_stack_lvl+0x73/0xb0 [ 25.633118] print_report+0xd1/0x640 [ 25.633552] ? __virt_addr_valid+0x1db/0x2d0 [ 25.633967] ? kasan_complete_mode_report_info+0x64/0x200 [ 25.635065] kasan_report+0x102/0x140 [ 25.635423] ? kmalloc_double_kzfree+0x19d/0x360 [ 25.636195] ? kmalloc_double_kzfree+0x19d/0x360 [ 25.637092] ? kmalloc_double_kzfree+0x19d/0x360 [ 25.638242] __kasan_check_byte+0x3d/0x50 [ 25.638634] kfree_sensitive+0x22/0x90 [ 25.639264] kmalloc_double_kzfree+0x19d/0x360 [ 25.639719] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 25.640577] ? __schedule+0xc3e/0x2790 [ 25.641014] ? __pfx_read_tsc+0x10/0x10 [ 25.641580] ? ktime_get_ts64+0x84/0x230 [ 25.642336] kunit_try_run_case+0x1b3/0x490 [ 25.642870] ? __pfx_kunit_try_run_case+0x10/0x10 [ 25.643771] ? _raw_spin_lock_irqsave+0xa2/0x110 [ 25.644455] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 25.645710] ? __kthread_parkme+0x82/0x160 [ 25.646062] ? preempt_count_sub+0x50/0x80 [ 25.646506] ? __pfx_kunit_try_run_case+0x10/0x10 [ 25.647154] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 25.647586] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.648458] kthread+0x257/0x310 [ 25.649264] ? __pfx_kthread+0x10/0x10 [ 25.649897] ret_from_fork+0x41/0x80 [ 25.650497] ? __pfx_kthread+0x10/0x10 [ 25.651183] ret_from_fork_asm+0x1a/0x30 [ 25.651731] </TASK> [ 25.652112] [ 25.652241] Allocated by task 200: [ 25.652407] kasan_save_stack+0x3d/0x60 [ 25.652558] kasan_save_track+0x18/0x40 [ 25.652694] kasan_save_alloc_info+0x3b/0x50 [ 25.652893] __kasan_kmalloc+0xb7/0xc0 [ 25.653355] __kmalloc_cache_noprof+0x184/0x410 [ 25.653769] kmalloc_double_kzfree+0xaa/0x360 [ 25.655094] kunit_try_run_case+0x1b3/0x490 [ 25.655547] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.656083] kthread+0x257/0x310 [ 25.656451] ret_from_fork+0x41/0x80 [ 25.657494] ret_from_fork_asm+0x1a/0x30 [ 25.657976] [ 25.658190] Freed by task 200: [ 25.658517] kasan_save_stack+0x3d/0x60 [ 25.659490] kasan_save_track+0x18/0x40 [ 25.660333] kasan_save_free_info+0x3f/0x60 [ 25.661053] __kasan_slab_free+0x56/0x70 [ 25.661327] kfree+0x123/0x3f0 [ 25.661777] kfree_sensitive+0x67/0x90 [ 25.662407] kmalloc_double_kzfree+0x12c/0x360 [ 25.663325] kunit_try_run_case+0x1b3/0x490 [ 25.664097] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.664787] kthread+0x257/0x310 [ 25.665678] ret_from_fork+0x41/0x80 [ 25.666000] ret_from_fork_asm+0x1a/0x30 [ 25.666523] [ 25.666740] The buggy address belongs to the object at ffff8881028346c0 [ 25.666740] which belongs to the cache kmalloc-16 of size 16 [ 25.667690] The buggy address is located 0 bytes inside of [ 25.667690] freed 16-byte region [ffff8881028346c0, ffff8881028346d0) [ 25.669222] [ 25.669819] The buggy address belongs to the physical page: [ 25.670557] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102834 [ 25.671401] flags: 0x200000000000000(node=0|zone=2) [ 25.672160] page_type: f5(slab) [ 25.672403] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 25.673429] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000 [ 25.674086] page dumped because: kasan: bad access detected [ 25.674695] [ 25.675118] Memory state around the buggy address: [ 25.675601] ffff888102834580: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc [ 25.677325] ffff888102834600: fa fb fc fc fa fb fc fc 00 05 fc fc fa fb fc fc [ 25.678288] >ffff888102834680: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc [ 25.678958] ^ [ 25.679558] ffff888102834700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.680775] ffff888102834780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.681605] ==================================================================