Re: [PATCH v1] kasan: Fix false-positive wild-memory-access on x86 under 5-level paging
From: Ihor Solodrai
Date: Mon Jun 22 2026 - 20:36:51 EST
On 6/18/26 10:09 AM, Borislav Petkov wrote:
> On Wed, Jun 17, 2026 at 03:13:33PM -0700, Ihor Solodrai wrote:
>> So my question to maintainers is what approach seems best?
>
> The CPUID stuff is being rewritten currently and it should address your issue
> too. If not, then we need to rewrite it better.
>
> Can you reproduce with this set applied ontop:
>
> https://lore.kernel.org/r/20260528153923.403473-1-darwi@xxxxxxxxxxxxx
Yes, the issue reproduces with this series.
Here is a splat:
[ 1.554117] BUG: KASAN: wild-memory-access in do_raw_spin_lock+0x121/0x270
[ 1.554117] Write of size 4 at addr ff110001000d10b8 by task swapper/0/0
[ 1.554117]
[ 1.554117] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 7.1.0-00120-g0f76bd3ff8c1 #19 PREEMPT(full)
[ 1.554117] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-5.el9 11/05/2023
[ 1.554117] Call Trace:
[ 1.554117] <IRQ>
[ 1.554117] dump_stack_lvl+0x68/0xa0
[ 1.554117] ? do_raw_spin_lock+0x121/0x270
[ 1.554117] kasan_report+0xca/0x100
[ 1.554117] ? do_raw_spin_lock+0x121/0x270
[ 1.554117] kasan_check_range+0x39/0x1c0
[ 1.554117] do_raw_spin_lock+0x121/0x270
[ 1.554117] ? __pfx_do_raw_spin_lock+0x10/0x10
[ 1.554117] handle_edge_irq+0x34/0x8b0
[ 1.554117] __common_interrupt+0x6e/0x170
[ 1.554117] common_interrupt+0x77/0xa0
[ 1.554117] </IRQ>
[ 1.554117] <TASK>
[ 1.554117] asm_common_interrupt+0x26/0x40
[ 1.554117] RIP: 0010:__cpuid_reset_table+0xf7/0x7b0
[ 1.554117] Code: 49 8d 7e 0c 45 8b 46 08 48 89 f8 48 c1 e8 03 4a 8d 2c 03 48 89 6c 24 68 42 0f b6 14 38 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 <84> d2 0f 85 da 04 00 00 45 8b 4e 0c 4c 89 f0 48 c1 e8 03 49 01 d9
[ 1.554117] RSP: 0000:ffffffff84c07d98 EFLAGS: 00010202
[ 1.554117] RAX: 0000000000000007 RBX: ffffffff85a7c990 RCX: 0000000000000000
[ 1.554117] RDX: 0000000000000000 RSI: fffffbfff0b4f91c RDI: ffffffff83c2dcac
[ 1.554117] RBP: ffffffff85a7c990 R08: 0000000000000000 R09: 0000000000000001
[ 1.554117] R10: ffffffff85a7c8ec R11: 0000000000000000 R12: 000000000000ffff
[ 1.554117] R13: ffffffff85a7c990 R14: ffffffff83c2dca0 R15: dffffc0000000000
[ 1.554117] ? __pfx___cpuid_reset_table+0x10/0x10
[ 1.554117] ? __pfx___mutex_unlock_slowpath+0x10/0x10
[ 1.554117] cpuid_scan_cpu_early+0x5a/0xd0
[ 1.554117] identify_cpu+0x2c1/0x13e0
[ 1.554117] ? lock_release+0xc9/0x290
[ 1.554117] arch_cpu_finalize_init+0x25/0x3c0
[ 1.554117] start_kernel+0x304/0x3f0
[ 1.554117] x86_64_start_reservations+0x18/0x30
[ 1.554117] x86_64_start_kernel+0x116/0x130
[ 1.554117] common_startup_64+0x12c/0x138
[ 1.554117] </TASK>
>
> ?
>