Linux-Integrity Archive on lore.kernel.org
 help / color / Atom feed
From: Nayna <nayna@linux.vnet.ibm.com>
To: Daniel Axtens <dja@axtens.net>
Cc: Nayna Jain <nayna@linux.ibm.com>,
	linuxppc-dev@ozlabs.org, linux-efi@vger.kernel.org,
	linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Jeremy Kerr <jk@ozlabs.org>,
	Matthew Garret <matthew.garret@nebula.com>,
	Mimi Zohar <zohar@linux.ibm.com>,
	Claudio Carvalho <cclaudio@linux.ibm.com>,
	Eric Richter <erichte@linux.ibm.com>
Subject: Re: [PATCH v3 1/3] powerpc/powernv: Add OPAL API interface to get secureboot state
Date: Fri, 14 Jun 2019 18:22:28 -0400
Message-ID: <b2cedb05-6373-b357-f35c-bc112c78a6fc@linux.vnet.ibm.com> (raw)
In-Reply-To: <87d0jipfr9.fsf@dja-thinkpad.axtens.net>



On 06/12/2019 07:04 PM, Daniel Axtens wrote:
> Hi Nayna,
>
>>>> 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.
>>>>
>>> (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.
>> Sorry, I think I am not clear on what exactly you mean here.Can you
>> please elaborate or give specifics ?
> Cryptosystems with greater flexibility can have new kinds of
> vulnerabilities arise from the greater complexity. The first sort of
> thing that comes to mind is a downgrade attack like from TLS. I think
> you're protected from this because the mode cannot be negotiatied at run
> time, but in general it's security sensitive code so I'd like it to be
> as simple as possible.
>
>>>    - 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?
>> The intention is to avoid to re-implement the key/value interface for
>> each scheme. Do you mean to deprecate the old APIs and add new APIs with
>> every scheme ?
> Yes, because I expect the scheme would change very, very rarely.

So, the design is not making the assumption that a particular scheme 
will change often. It is just allowing the flexibility for addition of 
new schemes or enhancements if needed.

>
>>>    - 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?
>> 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 -
>> https://lists.ozlabs.org/pipermail/skiboot/2019-June/014641.html
> I still feel like this is holding onto ongoing complexity for very
> little gain, but perhaps this is because I can't picture a specific
> change that would actually require a wholesale change to the scheme.

That is the exact reason for having pluggable backend, because we cannot 
determine now if there will be a need of new scheme in future or not.


>
> You mention new features, support for new authentication mechanisms, and
> addition of new variables.
>
>   - New features is a bit too generic to answer specifically. In general
>     I accept that there exists some new feature that would be
>     sufficiently backwards-incompatible as to require a new version. I
>     just can't think of one off the top of my head and so I'm not
>     convinced it's worth the complexity. Did you have something in mind?

That is the idea to keep the design flexible to be able to handle future 
additions with maximum reuse. Example, supporting new algorithms or a 
different handling of secure variable updates by different vendors.


>
>   - By support for new authentication mechanisms, I assume you mean new
>     mechanisms for authenticating variable updates? This is communicated
>     in edk2 via the attributes field. Looking at patch 5 from the skiboot
>     series:
>
> + * When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is set,
> + * then the Data buffer shall begin with an instance of a complete (and
> + * serialized) EFI_VARIABLE_AUTHENTICATION_2 descriptor.
>
>     Could a new authentication scheme be communicated by setting a
>     different attribute value? Or are we not carrying attributes in the
>     metadata blob?
>
>   - For addition of new variables, I'm confused as to why this would
>     require a new API - wouldn't it just be exposed in the normal way via
>     opal_secvar_get(_next)?

Sorry, probably it wasn't clear. By addition of new variables, we meant 
that over time we might have to add new "volatile" variables that "fine 
tunes" secure boot state. This might impact the kernel if it needs to 
understand new variables to define its policies. However, this will not 
result in change of API, it will result in change of the version.


>
> I guess I also somewhat object to calling it a 'backend' if we're using
> it as a version scheme. I think the skiboot storage backends are true
> backends - they provide different implementations of the same
> functionality with the same API, but this seems like you're using it to
> indicate different functionality. It seems like we're using it as if it
> were called OPAL_SECVAR_VERSION.

We are changing how we are exposing the version to the kernel. The 
version will be exposed as device-tree entry rather than a OPAL runtime 
service. We are not tied to the name "backend", we can switch to calling 
it as "scheme" unless there is a better name.

Thanks & Regards,
       - Nayna


  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 20:33 [PATCH v3 0/3] powerpc: Enabling IMA arch specific secure boot policies Nayna Jain
2019-06-10 20:33 ` [PATCH v3 1/3] powerpc/powernv: Add OPAL API interface to get secureboot state Nayna Jain
2019-06-12  6:17   ` Daniel Axtens
     [not found]     ` <eaa37bd0-a77d-d70a-feb5-c0e73ce231bf@linux.vnet.ibm.com>
2019-06-12 23:04       ` Daniel Axtens
2019-06-14 22:22         ` Nayna [this message]
2019-06-16 23:56           ` Daniel Axtens
2019-06-10 20:33 ` [PATCH v3 2/3] powerpc/powernv: detect the secure boot mode of the system Nayna Jain
2019-06-10 20:33 ` [PATCH v3 3/3] powerpc: Add support to initialize ima policy rules Nayna Jain
2019-06-11  5:19   ` Satheesh Rajendran
2019-06-11 17:07     ` Nayna

Reply instructions:

You may reply publically 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=b2cedb05-6373-b357-f35c-bc112c78a6fc@linux.vnet.ibm.com \
    --to=nayna@linux.vnet.ibm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=benh@kernel.crashing.org \
    --cc=cclaudio@linux.ibm.com \
    --cc=dja@axtens.net \
    --cc=erichte@linux.ibm.com \
    --cc=jk@ozlabs.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=matthew.garret@nebula.com \
    --cc=mpe@ellerman.id.au \
    --cc=nayna@linux.ibm.com \
    --cc=paulus@samba.org \
    --cc=zohar@linux.ibm.com \
    /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

Linux-Integrity Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-integrity/0 linux-integrity/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-integrity linux-integrity/ https://lore.kernel.org/linux-integrity \
		linux-integrity@vger.kernel.org linux-integrity@archiver.kernel.org
	public-inbox-index linux-integrity


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-integrity


AGPL code for this site: git clone https://public-inbox.org/ public-inbox