<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 06/12/2019 02:17 AM, Daniel Axtens
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:87ftofpbth.fsf@dja-thinkpad.axtens.net">
<pre wrap="">Nayna Jain <a class="moz-txt-link-rfc2396E" href="mailto:nayna@linux.ibm.com"><nayna@linux.ibm.com></a> writes:
</pre>
<blockquote type="cite">
<pre wrap="">From: Claudio Carvalho <a class="moz-txt-link-rfc2396E" href="mailto:cclaudio@linux.ibm.com"><cclaudio@linux.ibm.com></a>
The X.509 certificates trusted by the platform and other information
required to secure boot the OS kernel are wrapped in secure variables,
which are controlled by OPAL.
This patch adds support to read OPAL secure variables through
OPAL_SECVAR_GET call. It returns the metadata and data for a given secure
variable based on the unique key.
Since OPAL can support different types of backend which can vary in the
variable interpretation, a new OPAL API call named OPAL_SECVAR_BACKEND, is
added to retrieve the supported backend version. This helps the consumer
to know how to interpret the variable.
</pre>
</blockquote>
<pre wrap="">
(Firstly, apologies that I haven't got around to asking about this yet!)
Are pluggable/versioned backend a good idea?
There are a few things that worry me about the idea:
- It adds complexity in crypto (or crypto-adjacent) code, and that
increases the likelihood that we'll accidentally add a bug with bad
consequences.</pre>
</blockquote>
<br>
<span class="author-6932218873" style="font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px; color: rgb(34, 34, 34);">Sorry, I think I am not
clear on what exactly you mean here.</span><span
class="author-6932218873 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato, "Helvetica
Neue", Helvetica, Arial, sans-serif; font-size: 14px;"> </span><span
class="author-6932218873" style="font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px; color: rgb(34, 34, 34);">Can you please elaborate
or give specifics ?</span><br>
<br>
<br>
<blockquote type="cite"
cite="mid:87ftofpbth.fsf@dja-thinkpad.axtens.net">
<pre wrap="">
- Under what circumstances would would we change the kernel-visible
behaviour of skiboot? Are we expecting to change the behaviour,
content or names of the variables in future? Otherwise the only
relevant change I can think of is a change to hardware platforms, and
I'm not sure how a change in hardware would lead to change in
behaviour in the kernel. Wouldn't Skiboot hide h/w differences?</pre>
</blockquote>
<br>
<span class="author-6932218873" style="font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px; color: rgb(34, 34, 34);">Backends are intended to
be an agreement for firmware, kernel and userspace on what the
format of variables are, what variables should be expected, how
they should be signed, etc. Though we don't expect it to happen
very often, we want to anticipate possible changes in the firmware
which may affect the kernel such as new features, support of new
authentication mechanisms, addition of new variables.
Corresponding skiboot patches are on - </span><span
class="author-6932218873
link-MTU2MDM3MzE4NDE1My1odHRwczovL2xpc3RzLm96bGFicy5vcmcvcGlwZXJtYWlsL3NraWJvb3QvMjAxOS1KdW5lLzAxNDY0MS5odG1s"
style="font-family: Lato, "Helvetica Neue", Helvetica,
Arial, sans-serif; font-size: 14px; color: rgb(34, 34, 34);"><a
href="https://lists.ozlabs.org/pipermail/skiboot/2019-June/014641.html"
target="_blank" rel="noreferrer nofollow" class="link"
data-attrib-id="MTU2MDM3MzE4NDE1My1odHRwczovL2xpc3RzLm96bGFicy5vcmcvcGlwZXJtYWlsL3NraWJvb3QvMjAxOS1KdW5lLzAxNDY0MS5odG1s">https://lists.ozlabs.org/pipermail/skiboot/2019-June/014641.html</a></span><br>
<br>
<br>
<blockquote type="cite"
cite="mid:87ftofpbth.fsf@dja-thinkpad.axtens.net">
<pre wrap="">
- If we are worried about a long-term-future change to how secure-boot
works, would it be better to just add more get/set calls to opal at
the point at which we actually implement the new system?</pre>
</blockquote>
<br>
<span class="author-6932218873 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato, "Helvetica
Neue", Helvetica, Arial, sans-serif; font-size: 14px;">The
intention is to avoid to re-implement the key/value interface for
each scheme. Do yo</span><span class="author-6932218873"
style="font-family: Lato, "Helvetica Neue", Helvetica,
Arial, sans-serif; font-size: 14px; color: rgb(34, 34, 34);">u
mean to deprecate the old APIs and add new APIs with every scheme
?</span><br>
<br>
<br>
<blockquote type="cite"
cite="mid:87ftofpbth.fsf@dja-thinkpad.axtens.net">
<pre wrap="">
- UEFI added EFI_VARIABLE_AUTHENTICATION_3 in a way that - as far
as I know - didn't break backwards compatibility. Is there a reason
we cannot add features that way instead? (It also dropped v1 of the
authentication header.)
- What is the correct fallback behaviour if a kernel receives a result
that it does not expect? If a kernel expecting BackendV1 is instead
informed that it is running on BackendV2, then the cannot access the
secure variable at all, so it cannot load keys that are potentially
required to successfully boot (e.g. to validate the module for
network card or graphics!)</pre>
</blockquote>
<br>
<div data-node-type="line" id="magicdomid1119" class="ace-line"><span
class="author-6932218873 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;">The backend is </span><span
class="author-270238033 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;">declared</span><span class="author-6932218873
font-color-000000 font-size-medium" style="color: rgb(34, 34,
34); font-family: Lato, "Helvetica Neue", Helvetica,
Arial, sans-serif; font-size: 14px;"> by the firmware, </span><span
class="author-270238033 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;">and is set at compile-time. T</span><span
class="author-6932218873 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;">he kernel </span><span
class="author-270238033 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;">queries</span><span class="author-6932218873
font-color-000000 font-size-medium" style="color: rgb(34, 34,
34); font-family: Lato, "Helvetica Neue", Helvetica,
Arial, sans-serif; font-size: 14px;"> firmware </span><span
class="author-270238033 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;">on which</span><span class="author-6932218873
font-color-000000 font-size-medium" style="color: rgb(34, 34,
34); font-family: Lato, "Helvetica Neue", Helvetica,
Arial, sans-serif; font-size: 14px;"> backend </span><span
class="author-270238033 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;">is in use, and the backend will not change at
runtime.</span><span class="author-6932218873 font-color-000000
font-size-medium" style="color: rgb(34, 34, 34); font-family:
Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;"> </span><span class="author-270238033
font-color-000000 font-size-medium" style="color: rgb(34, 34,
34); font-family: Lato, "Helvetica Neue", Helvetica,
Arial, sans-serif; font-size: 14px;">If the backend in use by
the firmware is not supported by the kernel (e.g. kernel is too
old), the kernel does not attempt to read any secure variables,
as it won't understand what the format is. This is a secure boot
failure condition, as we cannot verify the next kernel. </span><span
class="author-270238033 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;"><span class="author-6932218873
font-color-000000 font-size-medium" style="color: rgb(34, 34,
34); font-family: Lato, "Helvetica Neue", Helvetica,
Arial, sans-serif; font-size: 14px;">With addition of new
backends in the skiboot, the support will be added to the
kernel.</span> Note: skiboot and skiroot should always be in
sync with backend support.</span><span class="author-6932218873
font-color-000000 font-size-medium" style="color: rgb(34, 34,
34); font-family: Lato, "Helvetica Neue", Helvetica,
Arial, sans-serif; font-size: 14px;"> </span></div>
<div data-node-type="line" id="magicdomid1320" class="ace-line"><span
class="author-6932218873 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;"></span><br>
<span class="author-6932218873 font-color-000000 font-size-medium"
style="color: rgb(34, 34, 34); font-family: Lato,
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;"></span></div>
<br>
Thanks & Regards,<br>
- Nayna<br>
<br>
</body>
</html>