lkml.org 
[lkml]   [2023]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/sev: Fix overflow when computing address for PVALIDATE
On 11/10/23 18:00, Michael Roth wrote:
> - vaddr = (unsigned long)pfn_to_kaddr(e->gfn);
> + vaddr = (unsigned long)pfn_to_kaddr((unsigned long)e->gfn);
> size = e->pagesize ? RMP_PG_SIZE_2M : RMP_PG_SIZE_4K;
> validate = e->operation == SNP_PAGE_STATE_PRIVATE;
>

... and people wonder why some of us avoid bitfields.

Shouldn't we just fix this permanently in pfn_to_kaddr()? Surely more
of these are lurking around. Anything doing a large shift up on a
little type is asking for trouble.

\
 
 \ /
  Last update: 2023-11-20 13:57    [W:0.028 / U:1.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site