[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5] sev: add sev-inject-launch-secret
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH v5] sev: add sev-inject-launch-secret |
Date: |
Tue, 20 Oct 2020 11:03:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 |
On 15/10/20 16:37, tobin@linux.ibm.com wrote:
> -static void *gpa2hva(MemoryRegion **p_mr, hwaddr addr, Error **errp)
> +void *gpa2hva(MemoryRegion **p_mr, hwaddr addr, uint64_t size, Error **errp)
> {
> MemoryRegionSection mrs = memory_region_find(get_system_memory(),
> - addr, 1);
> + addr, size);
You need to check size against mrs.size and fail if mrs.size is smaller.
Otherwise, the ioctl can access memory out of range.
Sorry Eduardo for the late review.
Paolo