lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z7yc8-QXXVPzr2K8@suse.de>
Date: Mon, 24 Feb 2025 17:23:15 +0100
From: Joerg Roedel <jroedel@...e.de>
To: Michael Roth <michael.roth@....com>
Cc: kvm@...r.kernel.org, linux-coco@...ts.linux.dev,
	linux-kernel@...r.kernel.org, pbonzini@...hat.com,
	seanjc@...gle.com, thomas.lendacky@....com, ashish.kalra@....com,
	liam.merwick@...cle.com, pankaj.gupta@....com,
	dionnaglaze@...gle.com, huibo.wang@....com
Subject: Re: [PATCH v5 1/1] KVM: Introduce KVM_EXIT_SNP_REQ_CERTS for SNP
 certificate-fetching

Hi Michael,

On Wed, Feb 19, 2025 at 09:15:05AM -0600, Michael Roth wrote:
> +  - If some other error occurred, userspace must set `ret` to ``EIO``.
> +    (This is to reserve special meaning for unused error codes in the
> +    future.)

[...]

> +static int snp_complete_req_certs(struct kvm_vcpu *vcpu)
> +{
> +	struct vcpu_svm *svm = to_svm(vcpu);
> +	struct vmcb_control_area *control = &svm->vmcb->control;
> +
> +	if (vcpu->run->snp_req_certs.ret) {
> +		if (vcpu->run->snp_req_certs.ret == ENOSPC) {
> +			vcpu->arch.regs[VCPU_REGS_RBX] = vcpu->run->snp_req_certs.npages;
> +			ghcb_set_sw_exit_info_2(svm->sev_es.ghcb,
> +						SNP_GUEST_ERR(SNP_GUEST_VMM_ERR_INVALID_LEN, 0));
> +		} else if (vcpu->run->snp_req_certs.ret == EAGAIN) {
> +			ghcb_set_sw_exit_info_2(svm->sev_es.ghcb,
> +						SNP_GUEST_ERR(SNP_GUEST_VMM_ERR_BUSY, 0));
> +		} else {
> +			ghcb_set_sw_exit_info_2(svm->sev_es.ghcb,
> +						SNP_GUEST_ERR(SNP_GUEST_VMM_ERR_GENERIC, 0));
> +		}

According to the documentation above, there should be a block checking
for EIO which injects SNP_GUEST_VMM_ERR_GENERIC and the else block
should return with EINVAL to user-space, no?

Regards,

-- 
Jörg Rödel
jroedel@...e.de

SUSE Software Solutions Germany GmbH
Frankenstraße 146
90461 Nürnberg
Germany
https://www.suse.com/

Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich
(HRB 36809, AG Nürnberg)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ