Re: [PATCH 1/1] x86/sev: Fix potential sign extension in amd_enc_status_change_finish()
From: Dave Hansen
Date: Thu Apr 23 2026 - 13:24:23 EST
On 4/22/26 19:10, YangWencheng wrote:
> When npages (int) is left-shifted by PAGE_SHIFT to calculate the size
> in bytes, the operation is performed on a signed integer. If npages is
> large enough, this can cause:
I kinda think the whole API around encryption is busted. The majority of
the callers have a virtual address and a bytes-based length argument and
convert it to pages.
Shouldn't we fix the API instead of hacking around it in a billion
little places?