Hay
Date
April 20, 2025, 11:09 p.m.

Environment
x15
x86

[   56.102111] ==================================================================
[   56.114196] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x398/0x3d8
[   56.120788] Read of size 1 at addr cc22bd88 by task kunit_try_catch/240
[   56.127441] 
[   56.128936] CPU: 1 UID: 0 PID: 240 Comm: kunit_try_catch Tainted: G    B   W        N  6.15.0-rc3 #1 NONE 
[   56.128967] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   56.128997] Hardware name: Generic DRA74X (Flattened Device Tree)
[   56.128997] Call trace: 
[   56.128997]  unwind_backtrace from show_stack+0x18/0x1c
[   56.129028]  show_stack from dump_stack_lvl+0x70/0x90
[   56.129058]  dump_stack_lvl from print_report+0x158/0x528
[   56.129089]  print_report from kasan_report+0xdc/0x118
[   56.129089]  kasan_report from kmalloc_uaf+0x398/0x3d8
[   56.129119]  kmalloc_uaf from kunit_try_run_case+0x22c/0x5a8
[   56.129150]  kunit_try_run_case from kunit_generic_run_threadfn_adapter+0xc4/0x128
[   56.129180]  kunit_generic_run_threadfn_adapter from kthread+0x464/0x810
[   56.129211]  kthread from ret_from_fork+0x14/0x20
[   56.129211] Exception stack(0xf249bfb0 to 0xf249bff8)
[   56.129241] bfa0:                                     00000000 00000000 00000000 00000000
[   56.129241] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   56.129272] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   56.129272] 
[   56.233093] Allocated by task 240:
[   56.236541]  kasan_save_track+0x30/0x5c
[   56.240386]  __kasan_kmalloc+0x8c/0x94
[   56.244171]  kmalloc_uaf+0xcc/0x3d8
[   56.247711]  kunit_try_run_case+0x22c/0x5a8
[   56.251922]  kunit_generic_run_threadfn_adapter+0xc4/0x128
[   56.257446]  kthread+0x464/0x810
[   56.260711]  ret_from_fork+0x14/0x20
[   56.264312] 
[   56.265808] Freed by task 240:
[   56.268890]  kasan_save_track+0x30/0x5c
[   56.272735]  kasan_save_free_info+0x3c/0x48
[   56.276977]  __kasan_slab_free+0x40/0x50
[   56.280914]  kfree+0xe8/0x384
[   56.283905]  kmalloc_uaf+0x174/0x3d8
[   56.287536]  kunit_try_run_case+0x22c/0x5a8
[   56.291748]  kunit_generic_run_threadfn_adapter+0xc4/0x128
[   56.297271]  kthread+0x464/0x810
[   56.300537]  ret_from_fork+0x14/0x20
[   56.304138] 
[   56.305633] The buggy address belongs to the object at cc22bd80
[   56.305633]  which belongs to the cache kmalloc-64 of size 64
[   56.317352] The buggy address is located 8 bytes inside of
[   56.317352]  freed 64-byte region [cc22bd80, cc22bdc0)
[   56.328033] 
[   56.329528] The buggy address belongs to the physical page:
[   56.335144] page: refcount:0 mapcount:0 mapping:00000000 index:0x0 pfn:0x8c22b
[   56.342407] flags: 0x0(zone=0)
[   56.345489] page_type: f5(slab)
[   56.348663] raw: 00000000 c7001300 00000122 00000000 00000000 80200020 f5000000 00000000
[   56.356811] raw: 00000000
[   56.359436] page dumped because: kasan: bad access detected
[   56.365051] 
[   56.366546] Memory state around the buggy address:
[   56.371368]  cc22bc80: 00 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   56.377960]  cc22bd00: 00 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   56.384521] >cc22bd80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   56.391082]               ^
[   56.393920]  cc22be00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   56.400482]  cc22be80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   56.407043] ==================================================================

[   27.033790] ==================================================================
[   27.045804] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   27.052338] Read of size 1 at addr ffff888105b98548 by task kunit_try_catch/227
[   27.059654] 
[   27.061152] CPU: 0 UID: 0 PID: 227 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc3 #1 PREEMPT(voluntary) 
[   27.061161] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.061163] Hardware name: Supermicro SYS-5019S-ML/X11SSH-F, BIOS 2.7 12/07/2021
[   27.061166] Call Trace:
[   27.061168]  <TASK>
[   27.061170]  dump_stack_lvl+0x73/0xb0
[   27.061174]  print_report+0xd1/0x650
[   27.061178]  ? __virt_addr_valid+0x1db/0x2d0
[   27.061181]  ? kmalloc_uaf+0x320/0x380
[   27.061185]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.061189]  ? kmalloc_uaf+0x320/0x380
[   27.061193]  kasan_report+0x141/0x180
[   27.061197]  ? kmalloc_uaf+0x320/0x380
[   27.061202]  __asan_report_load1_noabort+0x18/0x20
[   27.061205]  kmalloc_uaf+0x320/0x380
[   27.061209]  ? __pfx_kmalloc_uaf+0x10/0x10
[   27.061213]  ? __schedule+0x10cc/0x2b30
[   27.061217]  ? ktime_get_ts64+0x83/0x230
[   27.061222]  kunit_try_run_case+0x1a2/0x480
[   27.061227]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.061231]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.061235]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.061239]  ? __kthread_parkme+0x82/0x180
[   27.061243]  ? preempt_count_sub+0x50/0x80
[   27.061248]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.061252]  kunit_generic_run_threadfn_adapter+0x82/0xf0
[   27.061256]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.061260]  kthread+0x334/0x6f0
[   27.061264]  ? trace_preempt_on+0x20/0xc0
[   27.061268]  ? __pfx_kthread+0x10/0x10
[   27.061273]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.061277]  ? calculate_sigpending+0x7b/0xa0
[   27.061280]  ? __pfx_kthread+0x10/0x10
[   27.061284]  ret_from_fork+0x3e/0x80
[   27.061288]  ? __pfx_kthread+0x10/0x10
[   27.061292]  ret_from_fork_asm+0x1a/0x30
[   27.061298]  </TASK>
[   27.061300] 
[   27.221608] Allocated by task 227:
[   27.225013]  kasan_save_stack+0x45/0x70
[   27.228854]  kasan_save_track+0x18/0x40
[   27.232699]  kasan_save_alloc_info+0x3b/0x50
[   27.237015]  __kasan_kmalloc+0xb7/0xc0
[   27.240769]  __kmalloc_cache_noprof+0x189/0x420
[   27.245300]  kmalloc_uaf+0xaa/0x380
[   27.248792]  kunit_try_run_case+0x1a2/0x480
[   27.252980]  kunit_generic_run_threadfn_adapter+0x82/0xf0
[   27.258385]  kthread+0x334/0x6f0
[   27.261620]  ret_from_fork+0x3e/0x80
[   27.265198]  ret_from_fork_asm+0x1a/0x30
[   27.269124] 
[   27.270625] Freed by task 227:
[   27.273702]  kasan_save_stack+0x45/0x70
[   27.277558]  kasan_save_track+0x18/0x40
[   27.281394]  kasan_save_free_info+0x3f/0x60
[   27.285581]  __kasan_slab_free+0x56/0x70
[   27.289507]  kfree+0x222/0x3f0
[   27.292568]  kmalloc_uaf+0x12c/0x380
[   27.296146]  kunit_try_run_case+0x1a2/0x480
[   27.300332]  kunit_generic_run_threadfn_adapter+0x82/0xf0
[   27.305757]  kthread+0x334/0x6f0
[   27.308990]  ret_from_fork+0x3e/0x80
[   27.312576]  ret_from_fork_asm+0x1a/0x30
[   27.316502] 
[   27.318002] The buggy address belongs to the object at ffff888105b98540
[   27.318002]  which belongs to the cache kmalloc-16 of size 16
[   27.330342] The buggy address is located 8 bytes inside of
[   27.330342]  freed 16-byte region [ffff888105b98540, ffff888105b98550)
[   27.342328] 
[   27.343827] The buggy address belongs to the physical page:
[   27.349401] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105b98
[   27.357407] flags: 0x200000000000000(node=0|zone=2)
[   27.362288] page_type: f5(slab)
[   27.365433] raw: 0200000000000000 ffff888100042640 dead000000000122 0000000000000000
[   27.373172] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   27.380910] page dumped because: kasan: bad access detected
[   27.386483] 
[   27.387984] Memory state around the buggy address:
[   27.392775]  ffff888105b98400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.399994]  ffff888105b98480: 00 00 fc fc 00 00 fc fc 00 00 fc fc 00 06 fc fc
[   27.407213] >ffff888105b98500: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   27.414432]                                               ^
[   27.420005]  ffff888105b98580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.427224]  ffff888105b98600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.434443] ==================================================================