Hay
Date
May 12, 2025, 6:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.618327] ==================================================================
[   18.619445] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   18.619802] Read of size 16 at addr fff00000c1e7a0c0 by task kunit_try_catch/157
[   18.620873] 
[   18.621149] CPU: 0 UID: 0 PID: 157 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   18.621553] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.621595] Hardware name: linux,dummy-virt (DT)
[   18.621635] Call trace:
[   18.621662]  show_stack+0x20/0x38 (C)
[   18.621731]  dump_stack_lvl+0x8c/0xd0
[   18.621813]  print_report+0x118/0x608
[   18.621866]  kasan_report+0xdc/0x128
[   18.621917]  __asan_report_load16_noabort+0x20/0x30
[   18.621969]  kmalloc_uaf_16+0x3bc/0x438
[   18.622018]  kunit_try_run_case+0x170/0x3f0
[   18.622086]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.622146]  kthread+0x318/0x620
[   18.622197]  ret_from_fork+0x10/0x20
[   18.622253] 
[   18.627309] Allocated by task 157:
[   18.627765]  kasan_save_stack+0x3c/0x68
[   18.628284]  kasan_save_track+0x20/0x40
[   18.628781]  kasan_save_alloc_info+0x40/0x58
[   18.629251]  __kasan_kmalloc+0xd4/0xd8
[   18.629721]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.630282]  kmalloc_uaf_16+0x140/0x438
[   18.630850]  kunit_try_run_case+0x170/0x3f0
[   18.631326]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.632008]  kthread+0x318/0x620
[   18.632394]  ret_from_fork+0x10/0x20
[   18.632875] 
[   18.633212] Freed by task 157:
[   18.633609]  kasan_save_stack+0x3c/0x68
[   18.634138]  kasan_save_track+0x20/0x40
[   18.634663]  kasan_save_free_info+0x4c/0x78
[   18.635080]  __kasan_slab_free+0x6c/0x98
[   18.635420]  kfree+0x214/0x3c8
[   18.635707]  kmalloc_uaf_16+0x190/0x438
[   18.636247]  kunit_try_run_case+0x170/0x3f0
[   18.636664]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.637173]  kthread+0x318/0x620
[   18.637564]  ret_from_fork+0x10/0x20
[   18.638104] 
[   18.638458] The buggy address belongs to the object at fff00000c1e7a0c0
[   18.638458]  which belongs to the cache kmalloc-16 of size 16
[   18.639175] The buggy address is located 0 bytes inside of
[   18.639175]  freed 16-byte region [fff00000c1e7a0c0, fff00000c1e7a0d0)
[   18.640305] 
[   18.640597] The buggy address belongs to the physical page:
[   18.641196] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101e7a
[   18.641951] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.642622] page_type: f5(slab)
[   18.642951] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.643752] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.644473] page dumped because: kasan: bad access detected
[   18.644988] 
[   18.645257] Memory state around the buggy address:
[   18.645826]  fff00000c1e79f80: 00 05 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.646571]  fff00000c1e7a000: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.646987] >fff00000c1e7a080: 00 04 fc fc 00 00 fc fc fa fb fc fc fc fc fc fc
[   18.647477]                                            ^
[   18.648221]  fff00000c1e7a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.648815]  fff00000c1e7a180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.649592] ==================================================================

[   12.413978] ==================================================================
[   12.414882] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47d/0x4c0
[   12.415146] Read of size 16 at addr ffff888101b28000 by task kunit_try_catch/176
[   12.415877] 
[   12.416088] CPU: 1 UID: 0 PID: 176 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   12.416135] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.416147] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.416169] Call Trace:
[   12.416182]  <TASK>
[   12.416202]  dump_stack_lvl+0x73/0xb0
[   12.416232]  print_report+0xd1/0x650
[   12.416255]  ? __virt_addr_valid+0x1db/0x2d0
[   12.416278]  ? kmalloc_uaf_16+0x47d/0x4c0
[   12.416297]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.416323]  ? kmalloc_uaf_16+0x47d/0x4c0
[   12.416342]  kasan_report+0x140/0x180
[   12.416363]  ? kmalloc_uaf_16+0x47d/0x4c0
[   12.416387]  __asan_report_load16_noabort+0x18/0x20
[   12.416410]  kmalloc_uaf_16+0x47d/0x4c0
[   12.416429]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   12.416450]  ? __schedule+0xce8/0x2840
[   12.416474]  ? __pfx_read_tsc+0x10/0x10
[   12.416496]  ? ktime_get_ts64+0x86/0x230
[   12.416521]  kunit_try_run_case+0x1a6/0x480
[   12.416544]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.416565]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.416585]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.416609]  ? __kthread_parkme+0x82/0x160
[   12.416631]  ? preempt_count_sub+0x50/0x80
[   12.416656]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.416677]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.416702]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.416727]  kthread+0x324/0x6e0
[   12.416748]  ? trace_preempt_on+0x20/0xc0
[   12.416771]  ? __pfx_kthread+0x10/0x10
[   12.416792]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.416815]  ? calculate_sigpending+0x7b/0xa0
[   12.416847]  ? __pfx_kthread+0x10/0x10
[   12.416869]  ret_from_fork+0x41/0x80
[   12.416887]  ? __pfx_kthread+0x10/0x10
[   12.416909]  ret_from_fork_asm+0x1a/0x30
[   12.416940]  </TASK>
[   12.416951] 
[   12.428931] Allocated by task 176:
[   12.429258]  kasan_save_stack+0x45/0x70
[   12.429624]  kasan_save_track+0x18/0x40
[   12.429994]  kasan_save_alloc_info+0x3b/0x50
[   12.430533]  __kasan_kmalloc+0xb7/0xc0
[   12.430947]  __kmalloc_cache_noprof+0x18a/0x420
[   12.431413]  kmalloc_uaf_16+0x15c/0x4c0
[   12.431815]  kunit_try_run_case+0x1a6/0x480
[   12.432276]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.432522]  kthread+0x324/0x6e0
[   12.432654]  ret_from_fork+0x41/0x80
[   12.432786]  ret_from_fork_asm+0x1a/0x30
[   12.432940] 
[   12.433025] Freed by task 176:
[   12.433365]  kasan_save_stack+0x45/0x70
[   12.433783]  kasan_save_track+0x18/0x40
[   12.434231]  kasan_save_free_info+0x3f/0x60
[   12.434695]  __kasan_slab_free+0x56/0x70
[   12.435114]  kfree+0x224/0x3f0
[   12.435483]  kmalloc_uaf_16+0x1d7/0x4c0
[   12.435865]  kunit_try_run_case+0x1a6/0x480
[   12.436355]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.436863]  kthread+0x324/0x6e0
[   12.437108]  ret_from_fork+0x41/0x80
[   12.437544]  ret_from_fork_asm+0x1a/0x30
[   12.437720] 
[   12.437803] The buggy address belongs to the object at ffff888101b28000
[   12.437803]  which belongs to the cache kmalloc-16 of size 16
[   12.438735] The buggy address is located 0 bytes inside of
[   12.438735]  freed 16-byte region [ffff888101b28000, ffff888101b28010)
[   12.439980] 
[   12.440269] The buggy address belongs to the physical page:
[   12.440623] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b28
[   12.440880] flags: 0x200000000000000(node=0|zone=2)
[   12.441063] page_type: f5(slab)
[   12.441274] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.441580] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.441864] page dumped because: kasan: bad access detected
[   12.442202] 
[   12.442301] Memory state around the buggy address:
[   12.442496]  ffff888101b27f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.442811]  ffff888101b27f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.443037] >ffff888101b28000: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.443519]                    ^
[   12.443734]  ffff888101b28080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.443987]  ffff888101b28100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.444410] ==================================================================