Messages in this thread | | | Date | Sat, 11 Nov 2023 22:49:56 -0800 | From | Dave Hansen <> | Subject | Re: [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.
| |