Hay
Date
July 17, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.488437] ==================================================================
[   15.488681] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   15.488749] Write of size 33 at addr fff00000c7891c00 by task kunit_try_catch/187
[   15.488802] 
[   15.489022] CPU: 0 UID: 0 PID: 187 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.489215] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.489295] Hardware name: linux,dummy-virt (DT)
[   15.489337] Call trace:
[   15.489372]  show_stack+0x20/0x38 (C)
[   15.489550]  dump_stack_lvl+0x8c/0xd0
[   15.489607]  print_report+0x118/0x5d0
[   15.489786]  kasan_report+0xdc/0x128
[   15.489969]  kasan_check_range+0x100/0x1a8
[   15.490156]  __asan_memset+0x34/0x78
[   15.490226]  kmalloc_uaf_memset+0x170/0x310
[   15.490403]  kunit_try_run_case+0x170/0x3f0
[   15.490508]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.490574]  kthread+0x328/0x630
[   15.490785]  ret_from_fork+0x10/0x20
[   15.490844] 
[   15.490964] Allocated by task 187:
[   15.491280]  kasan_save_stack+0x3c/0x68
[   15.491368]  kasan_save_track+0x20/0x40
[   15.491501]  kasan_save_alloc_info+0x40/0x58
[   15.491568]  __kasan_kmalloc+0xd4/0xd8
[   15.491650]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.491815]  kmalloc_uaf_memset+0xb8/0x310
[   15.491942]  kunit_try_run_case+0x170/0x3f0
[   15.492061]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.492203]  kthread+0x328/0x630
[   15.492413]  ret_from_fork+0x10/0x20
[   15.492494] 
[   15.492693] Freed by task 187:
[   15.492771]  kasan_save_stack+0x3c/0x68
[   15.492918]  kasan_save_track+0x20/0x40
[   15.493046]  kasan_save_free_info+0x4c/0x78
[   15.493204]  __kasan_slab_free+0x6c/0x98
[   15.493279]  kfree+0x214/0x3c8
[   15.493312]  kmalloc_uaf_memset+0x11c/0x310
[   15.493699]  kunit_try_run_case+0x170/0x3f0
[   15.493801]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.494147]  kthread+0x328/0x630
[   15.494219]  ret_from_fork+0x10/0x20
[   15.494349] 
[   15.494392] The buggy address belongs to the object at fff00000c7891c00
[   15.494392]  which belongs to the cache kmalloc-64 of size 64
[   15.494491] The buggy address is located 0 bytes inside of
[   15.494491]  freed 64-byte region [fff00000c7891c00, fff00000c7891c40)
[   15.494689] 
[   15.494758] The buggy address belongs to the physical page:
[   15.494792] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107891
[   15.494938] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.495124] page_type: f5(slab)
[   15.495273] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   15.495402] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   15.495579] page dumped because: kasan: bad access detected
[   15.495613] 
[   15.495631] Memory state around the buggy address:
[   15.495714]  fff00000c7891b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.496017]  fff00000c7891b80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.496198] >fff00000c7891c00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.496356]                    ^
[   15.496400]  fff00000c7891c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.496460]  fff00000c7891d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.496500] ==================================================================

[   13.318633] ==================================================================
[   13.319079] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   13.319857] Write of size 33 at addr ffff888102a13100 by task kunit_try_catch/203
[   13.320191] 
[   13.320330] CPU: 0 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.320374] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.320386] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.320407] Call Trace:
[   13.320420]  <TASK>
[   13.320436]  dump_stack_lvl+0x73/0xb0
[   13.320467]  print_report+0xd1/0x610
[   13.320500]  ? __virt_addr_valid+0x1db/0x2d0
[   13.320524]  ? kmalloc_uaf_memset+0x1a3/0x360
[   13.320612]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.320642]  ? kmalloc_uaf_memset+0x1a3/0x360
[   13.320664]  kasan_report+0x141/0x180
[   13.320700]  ? kmalloc_uaf_memset+0x1a3/0x360
[   13.320727]  kasan_check_range+0x10c/0x1c0
[   13.320751]  __asan_memset+0x27/0x50
[   13.320781]  kmalloc_uaf_memset+0x1a3/0x360
[   13.320803]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   13.320826]  ? __schedule+0x10cc/0x2b60
[   13.320858]  ? __pfx_read_tsc+0x10/0x10
[   13.320880]  ? ktime_get_ts64+0x86/0x230
[   13.320904]  kunit_try_run_case+0x1a5/0x480
[   13.320941]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.320965]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.320989]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.321013]  ? __kthread_parkme+0x82/0x180
[   13.321034]  ? preempt_count_sub+0x50/0x80
[   13.321058]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.321082]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.321107]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.321132]  kthread+0x337/0x6f0
[   13.321151]  ? trace_preempt_on+0x20/0xc0
[   13.321174]  ? __pfx_kthread+0x10/0x10
[   13.321195]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.321216]  ? calculate_sigpending+0x7b/0xa0
[   13.321285]  ? __pfx_kthread+0x10/0x10
[   13.321309]  ret_from_fork+0x116/0x1d0
[   13.321329]  ? __pfx_kthread+0x10/0x10
[   13.321349]  ret_from_fork_asm+0x1a/0x30
[   13.321381]  </TASK>
[   13.321391] 
[   13.329480] Allocated by task 203:
[   13.329678]  kasan_save_stack+0x45/0x70
[   13.329895]  kasan_save_track+0x18/0x40
[   13.330080]  kasan_save_alloc_info+0x3b/0x50
[   13.330471]  __kasan_kmalloc+0xb7/0xc0
[   13.330670]  __kmalloc_cache_noprof+0x189/0x420
[   13.330902]  kmalloc_uaf_memset+0xa9/0x360
[   13.331107]  kunit_try_run_case+0x1a5/0x480
[   13.331438]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.331670]  kthread+0x337/0x6f0
[   13.331794]  ret_from_fork+0x116/0x1d0
[   13.331953]  ret_from_fork_asm+0x1a/0x30
[   13.332177] 
[   13.332271] Freed by task 203:
[   13.332427]  kasan_save_stack+0x45/0x70
[   13.332825]  kasan_save_track+0x18/0x40
[   13.333020]  kasan_save_free_info+0x3f/0x60
[   13.333255]  __kasan_slab_free+0x56/0x70
[   13.333501]  kfree+0x222/0x3f0
[   13.333665]  kmalloc_uaf_memset+0x12b/0x360
[   13.333816]  kunit_try_run_case+0x1a5/0x480
[   13.334023]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.334387]  kthread+0x337/0x6f0
[   13.334651]  ret_from_fork+0x116/0x1d0
[   13.334973]  ret_from_fork_asm+0x1a/0x30
[   13.335146] 
[   13.335241] The buggy address belongs to the object at ffff888102a13100
[   13.335241]  which belongs to the cache kmalloc-64 of size 64
[   13.335721] The buggy address is located 0 bytes inside of
[   13.335721]  freed 64-byte region [ffff888102a13100, ffff888102a13140)
[   13.336171] 
[   13.336261] The buggy address belongs to the physical page:
[   13.336489] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a13
[   13.338005] flags: 0x200000000000000(node=0|zone=2)
[   13.338612] page_type: f5(slab)
[   13.339079] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   13.339663] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   13.340341] page dumped because: kasan: bad access detected
[   13.340787] 
[   13.341040] Memory state around the buggy address:
[   13.341749]  ffff888102a13000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.342160]  ffff888102a13080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.343028] >ffff888102a13100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.343745]                    ^
[   13.344215]  ffff888102a13180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.344782]  ffff888102a13200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.345084] ==================================================================