Hay
Date
July 12, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.783721] ==================================================================
[   18.784023] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x2ec/0x320
[   18.784262] Read of size 1 at addr fff00000c4561a5f by task kunit_try_catch/139
[   18.784457] 
[   18.784629] CPU: 0 UID: 0 PID: 139 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   18.785194] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.785309] Hardware name: linux,dummy-virt (DT)
[   18.785394] Call trace:
[   18.785451]  show_stack+0x20/0x38 (C)
[   18.785585]  dump_stack_lvl+0x8c/0xd0
[   18.785700]  print_report+0x118/0x608
[   18.785815]  kasan_report+0xdc/0x128
[   18.785945]  __asan_report_load1_noabort+0x20/0x30
[   18.786293]  kmalloc_oob_left+0x2ec/0x320
[   18.786546]  kunit_try_run_case+0x170/0x3f0
[   18.786950]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.787369]  kthread+0x328/0x630
[   18.787872]  ret_from_fork+0x10/0x20
[   18.788183] 
[   18.788241] Allocated by task 26:
[   18.788315]  kasan_save_stack+0x3c/0x68
[   18.788792]  kasan_save_track+0x20/0x40
[   18.789153]  kasan_save_alloc_info+0x40/0x58
[   18.789378]  __kasan_kmalloc+0xd4/0xd8
[   18.789466]  __kmalloc_node_track_caller_noprof+0x194/0x4b8
[   18.790695]  kstrdup+0x54/0xc8
[   18.790781]  devtmpfs_work_loop+0x6f8/0xa58
[   18.791448]  devtmpfsd+0x50/0x58
[   18.791574]  kthread+0x328/0x630
[   18.791672]  ret_from_fork+0x10/0x20
[   18.791807] 
[   18.791918] Freed by task 26:
[   18.792010]  kasan_save_stack+0x3c/0x68
[   18.792932]  kasan_save_track+0x20/0x40
[   18.793073]  kasan_save_free_info+0x4c/0x78
[   18.793269]  __kasan_slab_free+0x6c/0x98
[   18.793364]  kfree+0x214/0x3c8
[   18.793570]  devtmpfs_work_loop+0x804/0xa58
[   18.793649]  devtmpfsd+0x50/0x58
[   18.793708]  kthread+0x328/0x630
[   18.794198]  ret_from_fork+0x10/0x20
[   18.794364] 
[   18.794481] The buggy address belongs to the object at fff00000c4561a40
[   18.794481]  which belongs to the cache kmalloc-16 of size 16
[   18.794634] The buggy address is located 15 bytes to the right of
[   18.794634]  allocated 16-byte region [fff00000c4561a40, fff00000c4561a50)
[   18.794991] 
[   18.795045] The buggy address belongs to the physical page:
[   18.795129] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104561
[   18.795448] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.795673] page_type: f5(slab)
[   18.796026] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.796236] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.796447] page dumped because: kasan: bad access detected
[   18.796535] 
[   18.796579] Memory state around the buggy address:
[   18.796668]  fff00000c4561900: 00 00 fc fc fa fb fc fc fa fb fc fc 00 05 fc fc
[   18.797055]  fff00000c4561980: fa fb fc fc fa fb fc fc 00 02 fc fc fa fb fc fc
[   18.797358] >fff00000c4561a00: fa fb fc fc 00 05 fc fc fa fb fc fc 00 07 fc fc
[   18.797480]                                                     ^
[   18.797566]  fff00000c4561a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.797669]  fff00000c4561b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.797749] ==================================================================

[   12.003866] ==================================================================
[   12.004408] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x361/0x3c0
[   12.004728] Read of size 1 at addr ffff8881028942df by task kunit_try_catch/156
[   12.005283] 
[   12.005395] CPU: 0 UID: 0 PID: 156 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.005437] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.005448] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.005468] Call Trace:
[   12.005480]  <TASK>
[   12.005496]  dump_stack_lvl+0x73/0xb0
[   12.005529]  print_report+0xd1/0x650
[   12.005551]  ? __virt_addr_valid+0x1db/0x2d0
[   12.005576]  ? kmalloc_oob_left+0x361/0x3c0
[   12.005597]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.005620]  ? kmalloc_oob_left+0x361/0x3c0
[   12.005887]  kasan_report+0x141/0x180
[   12.005914]  ? kmalloc_oob_left+0x361/0x3c0
[   12.005941]  __asan_report_load1_noabort+0x18/0x20
[   12.005966]  kmalloc_oob_left+0x361/0x3c0
[   12.005988]  ? __pfx_kmalloc_oob_left+0x10/0x10
[   12.006010]  ? __schedule+0x10cc/0x2b60
[   12.006033]  ? __pfx_read_tsc+0x10/0x10
[   12.006055]  ? ktime_get_ts64+0x86/0x230
[   12.006080]  kunit_try_run_case+0x1a5/0x480
[   12.006105]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.006128]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.006154]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.006178]  ? __kthread_parkme+0x82/0x180
[   12.006198]  ? preempt_count_sub+0x50/0x80
[   12.006222]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.006246]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.006270]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.006295]  kthread+0x337/0x6f0
[   12.006315]  ? trace_preempt_on+0x20/0xc0
[   12.006339]  ? __pfx_kthread+0x10/0x10
[   12.006364]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.006386]  ? calculate_sigpending+0x7b/0xa0
[   12.006411]  ? __pfx_kthread+0x10/0x10
[   12.006432]  ret_from_fork+0x116/0x1d0
[   12.006450]  ? __pfx_kthread+0x10/0x10
[   12.006470]  ret_from_fork_asm+0x1a/0x30
[   12.006502]  </TASK>
[   12.006513] 
[   12.013976] Allocated by task 1:
[   12.014154]  kasan_save_stack+0x45/0x70
[   12.014331]  kasan_save_track+0x18/0x40
[   12.014524]  kasan_save_alloc_info+0x3b/0x50
[   12.014804]  __kasan_kmalloc+0xb7/0xc0
[   12.014993]  __kmalloc_noprof+0x1c9/0x500
[   12.015133]  x509_fabricate_name.isra.0+0x3c2/0x830
[   12.015358]  x509_note_subject+0x9b/0xf0
[   12.015557]  asn1_ber_decoder+0xe13/0x1c60
[   12.015870]  x509_cert_parse+0x1be/0x830
[   12.016044]  x509_key_preparse+0x68/0x8a0
[   12.016242]  asymmetric_key_preparse+0xb1/0x160
[   12.016439]  __key_create_or_update+0x43d/0xcc0
[   12.016845]  key_create_or_update+0x17/0x20
[   12.017067]  x509_load_certificate_list+0x174/0x200
[   12.017281]  regulatory_init_db+0xee/0x3a0
[   12.017429]  do_one_initcall+0xd8/0x370
[   12.017563]  kernel_init_freeable+0x420/0x6f0
[   12.017852]  kernel_init+0x23/0x1e0
[   12.018034]  ret_from_fork+0x116/0x1d0
[   12.018222]  ret_from_fork_asm+0x1a/0x30
[   12.018419] 
[   12.018530] Freed by task 1:
[   12.018789]  kasan_save_stack+0x45/0x70
[   12.018966]  kasan_save_track+0x18/0x40
[   12.019163]  kasan_save_free_info+0x3f/0x60
[   12.019329]  __kasan_slab_free+0x56/0x70
[   12.019519]  kfree+0x222/0x3f0
[   12.019774]  x509_free_certificate.part.0+0xa9/0x140
[   12.020020]  x509_free_certificate+0x17/0x30
[   12.020172]  x509_key_preparse+0x5c9/0x8a0
[   12.020314]  asymmetric_key_preparse+0xb1/0x160
[   12.020483]  __key_create_or_update+0x43d/0xcc0
[   12.020898]  key_create_or_update+0x17/0x20
[   12.021118]  x509_load_certificate_list+0x174/0x200
[   12.021354]  regulatory_init_db+0xee/0x3a0
[   12.021555]  do_one_initcall+0xd8/0x370
[   12.021837]  kernel_init_freeable+0x420/0x6f0
[   12.022064]  kernel_init+0x23/0x1e0
[   12.022194]  ret_from_fork+0x116/0x1d0
[   12.022390]  ret_from_fork_asm+0x1a/0x30
[   12.022583] 
[   12.022776] The buggy address belongs to the object at ffff8881028942c0
[   12.022776]  which belongs to the cache kmalloc-16 of size 16
[   12.023210] The buggy address is located 15 bytes to the right of
[   12.023210]  allocated 16-byte region [ffff8881028942c0, ffff8881028942d0)
[   12.023768] 
[   12.023869] The buggy address belongs to the physical page:
[   12.024123] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102894
[   12.024473] flags: 0x200000000000000(node=0|zone=2)
[   12.024904] page_type: f5(slab)
[   12.025034] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.025262] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.025601] page dumped because: kasan: bad access detected
[   12.025960] 
[   12.026060] Memory state around the buggy address:
[   12.026285]  ffff888102894180: 00 02 fc fc 00 03 fc fc fa fb fc fc 00 02 fc fc
[   12.026614]  ffff888102894200: 00 05 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
[   12.026980] >ffff888102894280: 00 02 fc fc fa fb fc fc fa fb fc fc 00 07 fc fc
[   12.027298]                                                     ^
[   12.027539]  ffff888102894300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.027870]  ffff888102894380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.028159] ==================================================================