Hay
Date
Dec. 9, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   23.090193] ==================================================================
[   23.091452] BUG: KASAN: slab-out-of-bounds in kmalloc_node_oob_right+0x2f4/0x330
[   23.092672] Read of size 1 at addr fff00000c63cf000 by task kunit_try_catch/128
[   23.093542] 
[   23.093951] CPU: 1 UID: 0 PID: 128 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   23.095090] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.095819] Hardware name: linux,dummy-virt (DT)
[   23.096348] Call trace:
[   23.096782]  show_stack+0x20/0x38 (C)
[   23.097311]  dump_stack_lvl+0x8c/0xd0
[   23.097841]  print_report+0x118/0x5e0
[   23.098390]  kasan_report+0xc8/0x118
[   23.099229]  __asan_report_load1_noabort+0x20/0x30
[   23.100077]  kmalloc_node_oob_right+0x2f4/0x330
[   23.100781]  kunit_try_run_case+0x14c/0x3d0
[   23.101426]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.102156]  kthread+0x24c/0x2d0
[   23.102648]  ret_from_fork+0x10/0x20
[   23.103185] 
[   23.103506] Allocated by task 128:
[   23.104390]  kasan_save_stack+0x3c/0x68
[   23.104922]  kasan_save_track+0x20/0x40
[   23.105518]  kasan_save_alloc_info+0x40/0x58
[   23.106123]  __kasan_kmalloc+0xd4/0xd8
[   23.106580]  __kmalloc_cache_node_noprof+0x168/0x3d0
[   23.107445]  kmalloc_node_oob_right+0xbc/0x330
[   23.108078]  kunit_try_run_case+0x14c/0x3d0
[   23.108631]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.109316]  kthread+0x24c/0x2d0
[   23.109847]  ret_from_fork+0x10/0x20
[   23.110352] 
[   23.110646] The buggy address belongs to the object at fff00000c63ce000
[   23.110646]  which belongs to the cache kmalloc-4k of size 4096
[   23.112388] The buggy address is located 0 bytes to the right of
[   23.112388]  allocated 4096-byte region [fff00000c63ce000, fff00000c63cf000)
[   23.114044] 
[   23.114506] The buggy address belongs to the physical page:
[   23.115442] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063c8
[   23.116713] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   23.117422] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   23.118281] page_type: f5(slab)
[   23.118798] raw: 0bfffe0000000040 fff00000c0002140 dead000000000122 0000000000000000
[   23.119860] raw: 0000000000000000 0000000080040004 00000000f5000000 0000000000000000
[   23.120672] head: 0bfffe0000000040 fff00000c0002140 dead000000000122 0000000000000000
[   23.121609] head: 0000000000000000 0000000080040004 00000000f5000000 0000000000000000
[   23.122501] head: 0bfffe0000000003 ffffc1ffc318f201 ffffffffffffffff 0000000000000000
[   23.123553] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   23.124388] page dumped because: kasan: bad access detected
[   23.125031] 
[   23.125351] Memory state around the buggy address:
[   23.125914]  fff00000c63cef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.126614]  fff00000c63cef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.127485] >fff00000c63cf000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.128577]                    ^
[   23.129140]  fff00000c63cf080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.130061]  fff00000c63cf100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.131058] ==================================================================

[   22.650921] ==================================================================
[   22.651658] BUG: KASAN: slab-out-of-bounds in kmalloc_node_oob_right+0x36b/0x3d0
[   22.653109] Read of size 1 at addr ffff8881027e7000 by task kunit_try_catch/147
[   22.654778] 
[   22.655051] CPU: 0 UID: 0 PID: 147 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   22.656485] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.656753] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.658481] Call Trace:
[   22.658733]  <TASK>
[   22.659258]  dump_stack_lvl+0x73/0xb0
[   22.660047]  print_report+0xd1/0x640
[   22.660550]  ? __virt_addr_valid+0x1db/0x2d0
[   22.661625]  ? kasan_complete_mode_report_info+0x2a/0x200
[   22.662197]  kasan_report+0x102/0x140
[   22.663355]  ? kmalloc_node_oob_right+0x36b/0x3d0
[   22.664500]  ? kmalloc_node_oob_right+0x36b/0x3d0
[   22.665004]  __asan_report_load1_noabort+0x18/0x20
[   22.665483]  kmalloc_node_oob_right+0x36b/0x3d0
[   22.665905]  ? __pfx_kmalloc_node_oob_right+0x10/0x10
[   22.666878]  ? __schedule+0xc70/0x27e0
[   22.667496]  ? __pfx_read_tsc+0x10/0x10
[   22.668090]  ? ktime_get_ts64+0x86/0x230
[   22.668723]  kunit_try_run_case+0x1b3/0x490
[   22.670282]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.670763]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   22.671673]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.672632]  ? __kthread_parkme+0x82/0x160
[   22.673256]  ? preempt_count_sub+0x50/0x80
[   22.674203]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.674782]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.675783]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.676418]  kthread+0x257/0x310
[   22.677411]  ? __pfx_kthread+0x10/0x10
[   22.677990]  ret_from_fork+0x41/0x80
[   22.678331]  ? __pfx_kthread+0x10/0x10
[   22.678817]  ret_from_fork_asm+0x1a/0x30
[   22.679457]  </TASK>
[   22.679858] 
[   22.680074] Allocated by task 147:
[   22.680640]  kasan_save_stack+0x3d/0x60
[   22.681546]  kasan_save_track+0x18/0x40
[   22.681913]  kasan_save_alloc_info+0x3b/0x50
[   22.683221]  __kasan_kmalloc+0xb7/0xc0
[   22.684324]  __kmalloc_cache_node_noprof+0x183/0x410
[   22.684893]  kmalloc_node_oob_right+0xac/0x3d0
[   22.685771]  kunit_try_run_case+0x1b3/0x490
[   22.686547]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.687256]  kthread+0x257/0x310
[   22.687719]  ret_from_fork+0x41/0x80
[   22.688382]  ret_from_fork_asm+0x1a/0x30
[   22.689511] 
[   22.690039] The buggy address belongs to the object at ffff8881027e6000
[   22.690039]  which belongs to the cache kmalloc-4k of size 4096
[   22.691618] The buggy address is located 0 bytes to the right of
[   22.691618]  allocated 4096-byte region [ffff8881027e6000, ffff8881027e7000)
[   22.693932] 
[   22.694152] The buggy address belongs to the physical page:
[   22.695348] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027e0
[   22.696331] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   22.697962] flags: 0x200000000000040(head|node=0|zone=2)
[   22.699153] page_type: f5(slab)
[   22.699659] raw: 0200000000000040 ffff888100042140 dead000000000122 0000000000000000
[   22.700626] raw: 0000000000000000 0000000080040004 00000000f5000000 0000000000000000
[   22.701595] head: 0200000000000040 ffff888100042140 dead000000000122 0000000000000000
[   22.702148] head: 0000000000000000 0000000080040004 00000000f5000000 0000000000000000
[   22.703456] head: 0200000000000003 ffffea000409f801 ffffffffffffffff 0000000000000000
[   22.703758] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   22.706224] page dumped because: kasan: bad access detected
[   22.706709] 
[   22.707514] Memory state around the buggy address:
[   22.707894]  ffff8881027e6f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.709067]  ffff8881027e6f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.709922] >ffff8881027e7000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.710955]                    ^
[   22.711663]  ffff8881027e7080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.713087]  ffff8881027e7100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.713770] ==================================================================