[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 36/45] i386/sev: Invoke launch_updata_data() for SEV class
From: |
Peter Maydell |
Subject: |
Re: [PULL 36/45] i386/sev: Invoke launch_updata_data() for SEV class |
Date: |
Fri, 7 Jun 2024 15:18:02 +0100 |
On Tue, 4 Jun 2024 at 07:49, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Add launch_update_data() in SevCommonStateClass and
> invoke as sev_launch_update_data() for SEV object.
>
> Signed-off-by: Pankaj Gupta <pankaj.gupta@amd.com>
> Message-ID: <20240530111643.1091816-26-pankaj.gupta@amd.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Hi; Coverity points out an issue in this code (CID 1546886):
> sev_encrypt_flash(hwaddr gpa, uint8_t *ptr, uint64_t len, Error **errp)
> {
> SevCommonState *sev_common =
> SEV_COMMON(MACHINE(qdev_get_machine())->cgs);
> + SevCommonStateClass *klass = SEV_COMMON_GET_CLASS(sev_common);
SEV_COMMON_GET_CLASS() dereferences the pointer it is passed,
so it isn't valid to pass it a NULL pointer...
>
> if (!sev_common) {
> return 0;
...but we don't do the "return failure if passed NULL" until after
we've dereferenced sev_common.
The get-the-class-pointer operation should be done after this
check, I think.
thanks
-- PMM
- [PULL 40/45] i386/sev: Extract build_kernel_loader_hashes, (continued)
- [PULL 40/45] i386/sev: Extract build_kernel_loader_hashes, Paolo Bonzini, 2024/06/04
- [PULL 43/45] memory: Introduce memory_region_init_ram_guest_memfd(), Paolo Bonzini, 2024/06/04
- [PULL 45/45] hw/i386: Add support for loading BIOS using guest_memfd, Paolo Bonzini, 2024/06/04
- [PULL 31/45] i386/sev: Set CPU state to protected once SNP guest payload is finalized, Paolo Bonzini, 2024/06/04
- [PULL 29/45] i386/sev: Add the SNP launch start context, Paolo Bonzini, 2024/06/04
- [PULL 33/45] i386/sev: Add support for populating OVMF metadata pages, Paolo Bonzini, 2024/06/04
- [PULL 39/45] i386/sev: Enable KVM_HC_MAP_GPA_RANGE hcall for SNP guests, Paolo Bonzini, 2024/06/04
- [PULL 42/45] i386/sev: Allow measured direct kernel boot on SNP, Paolo Bonzini, 2024/06/04
- [PULL 28/45] i386/sev: Update query-sev QAPI format to handle SEV-SNP, Paolo Bonzini, 2024/06/04
- [PULL 36/45] i386/sev: Invoke launch_updata_data() for SEV class, Paolo Bonzini, 2024/06/04
- Re: [PULL 36/45] i386/sev: Invoke launch_updata_data() for SEV class,
Peter Maydell <=
- [PULL 44/45] hw/i386/sev: Use guest_memfd for legacy ROMs, Paolo Bonzini, 2024/06/04