Hay
Date
May 15, 2025, 10:38 a.m.

Environment
e850-96

[   29.155922] ==================================================================
[   29.166218] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   29.172727] Read of size 1 at addr ffff000800e20088 by task kunit_try_catch/229
[   29.180015] 
[   29.181502] CPU: 7 UID: 0 PID: 229 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   29.181568] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.181585] Hardware name: WinLink E850-96 board (DT)
[   29.181604] Call trace:
[   29.181617]  show_stack+0x20/0x38 (C)
[   29.181655]  dump_stack_lvl+0x8c/0xd0
[   29.181687]  print_report+0x118/0x608
[   29.181722]  kasan_report+0xdc/0x128
[   29.181754]  __asan_report_load1_noabort+0x20/0x30
[   29.181792]  kmalloc_uaf+0x300/0x338
[   29.181819]  kunit_try_run_case+0x170/0x3f0
[   29.181854]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.181891]  kthread+0x328/0x630
[   29.181928]  ret_from_fork+0x10/0x20
[   29.181963] 
[   29.244945] Allocated by task 229:
[   29.248331]  kasan_save_stack+0x3c/0x68
[   29.252148]  kasan_save_track+0x20/0x40
[   29.255967]  kasan_save_alloc_info+0x40/0x58
[   29.260220]  __kasan_kmalloc+0xd4/0xd8
[   29.263954]  __kmalloc_cache_noprof+0x15c/0x3c0
[   29.268467]  kmalloc_uaf+0xb8/0x338
[   29.271939]  kunit_try_run_case+0x170/0x3f0
[   29.276105]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.281575]  kthread+0x328/0x630
[   29.284786]  ret_from_fork+0x10/0x20
[   29.288345] 
[   29.289822] Freed by task 229:
[   29.292859]  kasan_save_stack+0x3c/0x68
[   29.296679]  kasan_save_track+0x20/0x40
[   29.300498]  kasan_save_free_info+0x4c/0x78
[   29.304665]  __kasan_slab_free+0x6c/0x98
[   29.308572]  kfree+0x214/0x3c8
[   29.311609]  kmalloc_uaf+0x11c/0x338
[   29.315168]  kunit_try_run_case+0x170/0x3f0
[   29.319334]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.324803]  kthread+0x328/0x630
[   29.328015]  ret_from_fork+0x10/0x20
[   29.331574] 
[   29.333051] The buggy address belongs to the object at ffff000800e20080
[   29.333051]  which belongs to the cache kmalloc-16 of size 16
[   29.345378] The buggy address is located 8 bytes inside of
[   29.345378]  freed 16-byte region [ffff000800e20080, ffff000800e20090)
[   29.357355] 
[   29.358834] The buggy address belongs to the physical page:
[   29.364390] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x880e20
[   29.372375] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.378884] page_type: f5(slab)
[   29.382021] raw: 0bfffe0000000000 ffff000800002640 dead000000000122 0000000000000000
[   29.389739] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   29.397460] page dumped because: kasan: bad access detected
[   29.403014] 
[   29.404489] Memory state around the buggy address:
[   29.409272]  ffff000800e1ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.416474]  ffff000800e20000: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.423678] >ffff000800e20080: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.430878]                       ^
[   29.434354]  ffff000800e20100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.441559]  ffff000800e20180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.448761] ==================================================================