Hay
Date
July 4, 2025, 3:11 p.m.

Environment
e850-96
qemu-x86_64

[   27.353328] ==================================================================
[   27.361981] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   27.369094] Write of size 33 at addr ffff000803afaa80 by task kunit_try_catch/235
[   27.376559] 
[   27.378043] CPU: 2 UID: 0 PID: 235 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc2 #1 PREEMPT 
[   27.378096] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.378114] Hardware name: WinLink E850-96 board (DT)
[   27.378136] Call trace:
[   27.378151]  show_stack+0x20/0x38 (C)
[   27.378185]  dump_stack_lvl+0x8c/0xd0
[   27.378225]  print_report+0x118/0x608
[   27.378257]  kasan_report+0xdc/0x128
[   27.378288]  kasan_check_range+0x100/0x1a8
[   27.378321]  __asan_memset+0x34/0x78
[   27.378353]  kmalloc_uaf_memset+0x170/0x310
[   27.378385]  kunit_try_run_case+0x170/0x3f0
[   27.378421]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.378460]  kthread+0x328/0x630
[   27.378495]  ret_from_fork+0x10/0x20
[   27.378529] 
[   27.443744] Allocated by task 235:
[   27.447133]  kasan_save_stack+0x3c/0x68
[   27.450949]  kasan_save_track+0x20/0x40
[   27.454769]  kasan_save_alloc_info+0x40/0x58
[   27.459022]  __kasan_kmalloc+0xd4/0xd8
[   27.462754]  __kmalloc_cache_noprof+0x16c/0x3c0
[   27.467268]  kmalloc_uaf_memset+0xb8/0x310
[   27.471348]  kunit_try_run_case+0x170/0x3f0
[   27.475514]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.480983]  kthread+0x328/0x630
[   27.484195]  ret_from_fork+0x10/0x20
[   27.487754] 
[   27.489231] Freed by task 235:
[   27.492268]  kasan_save_stack+0x3c/0x68
[   27.496087]  kasan_save_track+0x20/0x40
[   27.499907]  kasan_save_free_info+0x4c/0x78
[   27.504073]  __kasan_slab_free+0x6c/0x98
[   27.507979]  kfree+0x214/0x3c8
[   27.511017]  kmalloc_uaf_memset+0x11c/0x310
[   27.515184]  kunit_try_run_case+0x170/0x3f0
[   27.519351]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.524819]  kthread+0x328/0x630
[   27.528031]  ret_from_fork+0x10/0x20
[   27.531590] 
[   27.533067] The buggy address belongs to the object at ffff000803afaa80
[   27.533067]  which belongs to the cache kmalloc-64 of size 64
[   27.545396] The buggy address is located 0 bytes inside of
[   27.545396]  freed 64-byte region [ffff000803afaa80, ffff000803afaac0)
[   27.557371] 
[   27.558849] The buggy address belongs to the physical page:
[   27.564407] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x883afa
[   27.572390] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   27.578900] page_type: f5(slab)
[   27.582039] raw: 0bfffe0000000000 ffff0008000028c0 dead000000000122 0000000000000000
[   27.589756] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   27.597474] page dumped because: kasan: bad access detected
[   27.603030] 
[   27.604505] Memory state around the buggy address:
[   27.609287]  ffff000803afa980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.616490]  ffff000803afaa00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.623695] >ffff000803afaa80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.630894]                    ^
[   27.634110]  ffff000803afab00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.641314]  ffff000803afab80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.648517] ==================================================================

[   14.607484] ==================================================================
[   14.608021] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   14.608468] Write of size 33 at addr ffff8881029f1280 by task kunit_try_catch/207
[   14.608962] 
[   14.609113] CPU: 1 UID: 0 PID: 207 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc2 #1 PREEMPT(voluntary) 
[   14.609176] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.609190] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.609214] Call Trace:
[   14.609231]  <TASK>
[   14.609257]  dump_stack_lvl+0x73/0xb0
[   14.609294]  print_report+0xd1/0x650
[   14.609320]  ? __virt_addr_valid+0x1db/0x2d0
[   14.609379]  ? kmalloc_uaf_memset+0x1a3/0x360
[   14.609430]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.609488]  ? kmalloc_uaf_memset+0x1a3/0x360
[   14.609533]  kasan_report+0x141/0x180
[   14.609581]  ? kmalloc_uaf_memset+0x1a3/0x360
[   14.609649]  kasan_check_range+0x10c/0x1c0
[   14.609787]  __asan_memset+0x27/0x50
[   14.609833]  kmalloc_uaf_memset+0x1a3/0x360
[   14.609882]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   14.609932]  ? __schedule+0x10cc/0x2b60
[   14.609981]  ? __pfx_read_tsc+0x10/0x10
[   14.610027]  ? ktime_get_ts64+0x86/0x230
[   14.610080]  kunit_try_run_case+0x1a5/0x480
[   14.610124]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.610160]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.610210]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.610259]  ? __kthread_parkme+0x82/0x180
[   14.610302]  ? preempt_count_sub+0x50/0x80
[   14.610331]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.610376]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.610401]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.610424]  kthread+0x337/0x6f0
[   14.610442]  ? trace_preempt_on+0x20/0xc0
[   14.610467]  ? __pfx_kthread+0x10/0x10
[   14.610486]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.610508]  ? calculate_sigpending+0x7b/0xa0
[   14.610530]  ? __pfx_kthread+0x10/0x10
[   14.610549]  ret_from_fork+0x41/0x80
[   14.610570]  ? __pfx_kthread+0x10/0x10
[   14.610589]  ret_from_fork_asm+0x1a/0x30
[   14.610623]  </TASK>
[   14.610636] 
[   14.624985] Allocated by task 207:
[   14.625886]  kasan_save_stack+0x45/0x70
[   14.626511]  kasan_save_track+0x18/0x40
[   14.626826]  kasan_save_alloc_info+0x3b/0x50
[   14.626948]  __kasan_kmalloc+0xb7/0xc0
[   14.627043]  __kmalloc_cache_noprof+0x189/0x420
[   14.627220]  kmalloc_uaf_memset+0xa9/0x360
[   14.627740]  kunit_try_run_case+0x1a5/0x480
[   14.627991]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.628654]  kthread+0x337/0x6f0
[   14.628897]  ret_from_fork+0x41/0x80
[   14.629140]  ret_from_fork_asm+0x1a/0x30
[   14.629907] 
[   14.630148] Freed by task 207:
[   14.630678]  kasan_save_stack+0x45/0x70
[   14.631002]  kasan_save_track+0x18/0x40
[   14.631521]  kasan_save_free_info+0x3f/0x60
[   14.631798]  __kasan_slab_free+0x56/0x70
[   14.632019]  kfree+0x222/0x3f0
[   14.632461]  kmalloc_uaf_memset+0x12b/0x360
[   14.632809]  kunit_try_run_case+0x1a5/0x480
[   14.633145]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.634002]  kthread+0x337/0x6f0
[   14.634280]  ret_from_fork+0x41/0x80
[   14.634492]  ret_from_fork_asm+0x1a/0x30
[   14.634814] 
[   14.634995] The buggy address belongs to the object at ffff8881029f1280
[   14.634995]  which belongs to the cache kmalloc-64 of size 64
[   14.635667] The buggy address is located 0 bytes inside of
[   14.635667]  freed 64-byte region [ffff8881029f1280, ffff8881029f12c0)
[   14.636315] 
[   14.636809] The buggy address belongs to the physical page:
[   14.637149] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029f1
[   14.638102] flags: 0x200000000000000(node=0|zone=2)
[   14.638653] page_type: f5(slab)
[   14.638899] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   14.639473] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   14.639894] page dumped because: kasan: bad access detected
[   14.640139] 
[   14.640673] Memory state around the buggy address:
[   14.641145]  ffff8881029f1180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   14.641659]  ffff8881029f1200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   14.641978] >ffff8881029f1280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   14.642505]                    ^
[   14.642676]  ffff8881029f1300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.643158]  ffff8881029f1380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.644005] ==================================================================