From: Borislav Petkov <bp@alien8.de>
To: Dionna Amalie Glaze <dionnaglaze@google.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
Peter Gonda <pgonda@google.com>,
Thomas Lendacky <Thomas.Lendacky@amd.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Joerg Roedel <jroedel@suse.de>, Ingo Molnar <mingo@redhat.com>,
Andy Lutomirsky <luto@kernel.org>,
John Allen <john.allen@amd.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v8 1/4] crypto: ccp - Name -1 return value as SEV_RET_NO_FW_CALL
Date: Tue, 6 Dec 2022 22:26:22 +0100 [thread overview]
Message-ID: <Y4+zfgU639095B6K@zn.tnic> (raw)
In-Reply-To: <CAAH4kHbZM9YW0BvwxrQNFysHwB8JkPJzFRN9RdwhmixhbtsCyw@mail.gmail.com>
On Mon, Dec 05, 2022 at 09:05:19AM -0800, Dionna Amalie Glaze wrote:
> Arguably it shouldn't ever get this value. We're just not very
> selective when we copy back the kernel copy of the ioctl argument.
> In all cases user space should treat the value as undefined, but still
> we don't want to leak uninitialized kernel stack values.
Absolutely.
> I've changed it to -1 to name the same kind of error across host and
> guest: the communication with the PSP didn't complete successfully, so
> the "error" value is not from the PSP.
> This value can also get returned to user space during a -ENOTTY result.
> We can call this NO_FW_CALL or UNDEFINED. I have no real preference.
Me neither as long as this is written down and agreed upon as a possible
value and not leaking kernel stack.
> Whatever value we set initially, the VMM can overwrite exitinfo2
> during the ghcb_hv_call.
> I'd rather that the "undefined" values were the same across both,
> because the guest is merely receiving a value from the host's PSP
> driver (or should be).
> It keeps the enum for return values a bit tidier and not concerned
> with whether the value is viewed from the host or guest.
Ack.
...
> I hope the above discussion is clear that it's purely a defined
> "undefined" because being pickier about what to copy_to_user during
> exceptional circumstances in order to not overwrite the user's fw_err
> value seems an unnecessary amount of code.
Ok, I think we're on the same page. So pls document that NO_FW_CALL or
so value and what it means and that thing should be taken care of.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2022-12-06 21:26 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 23:00 [PATCH v8 0/4] Add throttling detection to sev-guest Dionna Glaze
2022-11-04 23:00 ` [PATCH v8 1/4] crypto: ccp - Name -1 return value as SEV_RET_NO_FW_CALL Dionna Glaze
2022-11-14 20:53 ` Tom Lendacky
2022-12-03 12:26 ` Borislav Petkov
2022-12-03 18:58 ` Dionna Amalie Glaze
2022-12-03 19:37 ` Borislav Petkov
2022-12-05 17:05 ` Dionna Amalie Glaze
2022-12-06 20:36 ` Tom Lendacky
2022-12-06 21:26 ` Borislav Petkov [this message]
2022-11-04 23:00 ` [PATCH v8 2/4] x86/sev: Change snp_guest_issue_request's fw_err Dionna Glaze
2022-11-05 1:33 ` Peter Gonda
2022-11-14 21:01 ` Tom Lendacky
2022-12-05 16:34 ` Borislav Petkov
2022-11-04 23:00 ` [PATCH v8 3/4] virt: sev-guest: Remove err in handle_guest_request Dionna Glaze
2022-11-05 1:33 ` Peter Gonda
2022-11-14 21:12 ` Tom Lendacky
2022-11-04 23:00 ` [PATCH v8 4/4] virt: sev-guest: interpret VMM errors from guest request Dionna Glaze
2022-11-05 1:33 ` Peter Gonda
2022-11-07 17:24 ` Peter Gonda
2022-11-14 21:21 ` Tom Lendacky
[not found] ` <CAAH4kHY-zq_WrZK1-Jne8LURwY5K_6orK3NuZbVn9u+gwQdN=w@mail.gmail.com>
2022-11-16 0:40 ` Dionna Amalie Glaze
2022-11-29 17:18 ` Dionna Amalie Glaze
2022-12-02 13:42 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y4+zfgU639095B6K@zn.tnic \
--to=bp@alien8.de \
--cc=Thomas.Lendacky@amd.com \
--cc=davem@davemloft.net \
--cc=dionnaglaze@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=john.allen@amd.com \
--cc=jroedel@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pgonda@google.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®