Re: [PATCH] x86/hyperv: use pointed-to type size for page table offsets
From: Wei Liu
Date: Mon Nov 02 2026 - 20:12:42 EST
On Sun, Nov 01, 2026 at 10:41:05PM +0000, Michael Kelley wrote:
> From: mdshahid03@xxxxxxxxx <mdshahid03@xxxxxxxxx> Sent: Sunday, November 1, 2026 1:21 AM
> >
> > The Hyper-V crash trampoline code calculated page table entry
> > offsets using sizeof() on pointer variables.
> >
> > Use sizeof(*ptr) instead to calculates the size of the
> > pointed-to page table entry.
> >
> > This makes entry size explicit and avoids relying on the
> > pointer size matching the page table entry size.
> >
> > This issue was reported by Coccinelle script noderef.cocci.
>
> FWIW, this issue was also reported by the kernel test robot.
> See [1] & [2]. So you should probably add "Reported-by:" and
> "Closes: " tags for those reports.
>
> In any case, the fix looks good to me.
>
> Reviewed-by: Michael Kelley <mhklinux@xxxxxxxxxxx>
>
> [1] https://lore.kernel.org/lkml/202603101143.qUL1R1iy-lkp@xxxxxxxxx/
> [2] https://lore.kernel.org/lkml/202610080503.ivDF5iYX-lkp@xxxxxxxxx/
Applied. Thanks.
Wei