Hay
Date
Dec. 3, 2024, 11:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   29.102668] ==================================================================
[   29.104114] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x2ec/0x320
[   29.104779] Read of size 1 at addr fff00000c631831f by task kunit_try_catch/127
[   29.105561] 
[   29.105938] CPU: 0 UID: 0 PID: 127 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   29.107257] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.107784] Hardware name: linux,dummy-virt (DT)
[   29.108455] Call trace:
[   29.108860]  show_stack+0x20/0x38 (C)
[   29.109484]  dump_stack_lvl+0x8c/0xd0
[   29.110142]  print_report+0x118/0x5e0
[   29.110831]  kasan_report+0xc8/0x118
[   29.111495]  __asan_report_load1_noabort+0x20/0x30
[   29.112200]  kmalloc_oob_left+0x2ec/0x320
[   29.112773]  kunit_try_run_case+0x14c/0x3d0
[   29.113428]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.114233]  kthread+0x24c/0x2d0
[   29.114902]  ret_from_fork+0x10/0x20
[   29.115728] 
[   29.116038] Allocated by task 28:
[   29.116430]  kasan_save_stack+0x3c/0x68
[   29.117031]  kasan_save_track+0x20/0x40
[   29.117916]  kasan_save_alloc_info+0x40/0x58
[   29.118602]  __kasan_kmalloc+0xd4/0xd8
[   29.119131]  __kmalloc_node_track_caller_noprof+0x184/0x4b8
[   29.120047]  kstrdup+0x54/0xc8
[   29.120706]  devtmpfs_work_loop+0x384/0x590
[   29.121360]  devtmpfsd+0x50/0x58
[   29.121896]  kthread+0x24c/0x2d0
[   29.122522]  ret_from_fork+0x10/0x20
[   29.123186] 
[   29.123696] Freed by task 28:
[   29.124739]  kasan_save_stack+0x3c/0x68
[   29.125260]  kasan_save_track+0x20/0x40
[   29.125781]  kasan_save_free_info+0x4c/0x78
[   29.126591]  __kasan_slab_free+0x6c/0x98
[   29.127511]  kfree+0x114/0x3c8
[   29.128051]  devtmpfs_work_loop+0x498/0x590
[   29.128547]  devtmpfsd+0x50/0x58
[   29.129177]  kthread+0x24c/0x2d0
[   29.130044]  ret_from_fork+0x10/0x20
[   29.130694] 
[   29.130979] The buggy address belongs to the object at fff00000c6318300
[   29.130979]  which belongs to the cache kmalloc-16 of size 16
[   29.132225] The buggy address is located 15 bytes to the right of
[   29.132225]  allocated 16-byte region [fff00000c6318300, fff00000c6318310)
[   29.134155] 
[   29.134480] The buggy address belongs to the physical page:
[   29.135921] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106318
[   29.137097] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.138143] page_type: f5(slab)
[   29.139030] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   29.140508] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   29.141418] page dumped because: kasan: bad access detected
[   29.142091] 
[   29.143009] Memory state around the buggy address:
[   29.143971]  fff00000c6318200: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.144690]  fff00000c6318280: fa fb fc fc fa fb fc fc 00 02 fc fc 00 02 fc fc
[   29.145376] >fff00000c6318300: fa fb fc fc 00 07 fc fc fc fc fc fc fc fc fc fc
[   29.146072]                             ^
[   29.146544]  fff00000c6318380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.148145]  fff00000c6318400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.149228] ==================================================================

[   24.709296] ==================================================================
[   24.710384] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x363/0x3c0
[   24.711229] Read of size 1 at addr ffff88810257337f by task kunit_try_catch/147
[   24.712301] 
[   24.712551] CPU: 1 UID: 0 PID: 147 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   24.713176] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.713855] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.715219] Call Trace:
[   24.715433]  <TASK>
[   24.716112]  dump_stack_lvl+0x73/0xb0
[   24.716491]  print_report+0xd1/0x640
[   24.716885]  ? __virt_addr_valid+0x1db/0x2d0
[   24.717152]  ? kasan_complete_mode_report_info+0x64/0x200
[   24.718396]  kasan_report+0x102/0x140
[   24.719118]  ? kmalloc_oob_left+0x363/0x3c0
[   24.719482]  ? kmalloc_oob_left+0x363/0x3c0
[   24.720071]  __asan_report_load1_noabort+0x18/0x20
[   24.720387]  kmalloc_oob_left+0x363/0x3c0
[   24.720818]  ? __pfx_kmalloc_oob_left+0x10/0x10
[   24.721228]  ? __schedule+0xc3e/0x2790
[   24.721634]  ? __pfx_read_tsc+0x10/0x10
[   24.722125]  ? ktime_get_ts64+0x86/0x230
[   24.722473]  kunit_try_run_case+0x1b3/0x490
[   24.724000]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.724444]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   24.725256]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.725676]  ? __kthread_parkme+0x82/0x160
[   24.726346]  ? preempt_count_sub+0x50/0x80
[   24.726645]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.727000]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.727478]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.727900]  kthread+0x257/0x310
[   24.728417]  ? __pfx_kthread+0x10/0x10
[   24.729579]  ret_from_fork+0x41/0x80
[   24.730128]  ? __pfx_kthread+0x10/0x10
[   24.730721]  ret_from_fork_asm+0x1a/0x30
[   24.731173]  </TASK>
[   24.731567] 
[   24.731973] Allocated by task 1:
[   24.732272]  kasan_save_stack+0x3d/0x60
[   24.732948]  kasan_save_track+0x18/0x40
[   24.733358]  kasan_save_alloc_info+0x3b/0x50
[   24.734240]  __kasan_kmalloc+0xb7/0xc0
[   24.735111]  __kmalloc_noprof+0x1c4/0x500
[   24.735550]  x509_fabricate_name.isra.0+0x3c2/0x860
[   24.736184]  x509_note_subject+0x9b/0xf0
[   24.736782]  asn1_ber_decoder+0xe1f/0x1c70
[   24.737180]  x509_cert_parse+0x1be/0x830
[   24.737687]  x509_key_preparse+0x68/0x8a0
[   24.738246]  asymmetric_key_preparse+0xb1/0x160
[   24.739138]  __key_create_or_update+0x407/0xc90
[   24.739568]  key_create_or_update+0x17/0x20
[   24.740152]  x509_load_certificate_list+0x174/0x200
[   24.740708]  regulatory_init_db+0xee/0x3a0
[   24.741318]  do_one_initcall+0xb5/0x370
[   24.741581]  kernel_init_freeable+0x425/0x6f0
[   24.742034]  kernel_init+0x23/0x1e0
[   24.742658]  ret_from_fork+0x41/0x80
[   24.743227]  ret_from_fork_asm+0x1a/0x30
[   24.743749] 
[   24.743955] Freed by task 1:
[   24.744502]  kasan_save_stack+0x3d/0x60
[   24.745169]  kasan_save_track+0x18/0x40
[   24.745758]  kasan_save_free_info+0x3f/0x60
[   24.746143]  __kasan_slab_free+0x56/0x70
[   24.746786]  kfree+0x123/0x3f0
[   24.747087]  x509_free_certificate.part.0+0xa9/0x140
[   24.747405]  x509_free_certificate+0x17/0x30
[   24.748989]  x509_key_preparse+0x5c9/0x8a0
[   24.749475]  asymmetric_key_preparse+0xb1/0x160
[   24.750048]  __key_create_or_update+0x407/0xc90
[   24.750517]  key_create_or_update+0x17/0x20
[   24.751041]  x509_load_certificate_list+0x174/0x200
[   24.751721]  regulatory_init_db+0xee/0x3a0
[   24.752330]  do_one_initcall+0xb5/0x370
[   24.752925]  kernel_init_freeable+0x425/0x6f0
[   24.753319]  kernel_init+0x23/0x1e0
[   24.753697]  ret_from_fork+0x41/0x80
[   24.754787]  ret_from_fork_asm+0x1a/0x30
[   24.755409] 
[   24.755842] The buggy address belongs to the object at ffff888102573360
[   24.755842]  which belongs to the cache kmalloc-16 of size 16
[   24.756705] The buggy address is located 15 bytes to the right of
[   24.756705]  allocated 16-byte region [ffff888102573360, ffff888102573370)
[   24.757537] 
[   24.757813] The buggy address belongs to the physical page:
[   24.758916] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102573
[   24.760006] flags: 0x200000000000000(node=0|zone=2)
[   24.760378] page_type: f5(slab)
[   24.760628] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   24.761428] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   24.762251] page dumped because: kasan: bad access detected
[   24.763018] 
[   24.763240] Memory state around the buggy address:
[   24.763918]  ffff888102573200: 00 00 fc fc 00 00 fc fc fa fb fc fc 00 00 fc fc
[   24.764304]  ffff888102573280: fa fb fc fc 00 05 fc fc 00 05 fc fc fa fb fc fc
[   24.765225] >ffff888102573300: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   24.766598]                                                                 ^
[   24.767455]  ffff888102573380: 00 07 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.768363]  ffff888102573400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.769032] ==================================================================