public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems
Date: Thu, 16 Oct 2014 05:30:38 +0300	[thread overview]
Message-ID: <20141016053038.53368d1a@i7> (raw)
In-Reply-To: <20141015143932.GE20034@leverpostej>

On Wed, 15 Oct 2014 15:39:32 +0100
Mark Rutland <mark.rutland@arm.com> wrote:

> [...]
> 
> > Other than this, are you really happy about granting the users full
> > rights to allow booting the kernel in the secure mode via a simple
> > environment variables tweak? Can't it potentially become a security
> > breach in some scenarios?
> 
> U-Boot must be running in secure mode in order to boot a kernel in
> secure mode. If U-Boot has been placed in secure mode with such an
> option, there is obviously nothing in the secure world to protect. As
> the user is in charge of booting the kernel, there is nothing in the
> normal world to protect.
> 
> There is no security breach here.

OK, it's good to know that this change does not increase the attack
surface.

> > > > Or are you saying that it is really impossible to distinguish your
> > > > use case of having the appended DT without resorting to the use of the
> > > > environment config options?
> > > 
> > > Think of it. How do you find out about what the kernel wants? This is
> > > just a blob...
> > 
> > The FDT blob has a header with an easily recognisable signature. So we
> > can see the difference between the FDT and FEX blobs if the blob is
> > provided to u-boot. And if no blob is provided at all, then we are sure
> > that it can't be booted by the sunxi-3.4 kernel.
> 
> FEX vs DT is specific to sunxi, whereas an explcit boot mode option is
> more generally useful. It is possible to have a kernel which can boot in
> either mode, where the security state the kernel runs in is a user
> choice, regardless of the presence or absence of a DTB.

Indeed. The patch from Hans primarily targets sunxi hardware, but
clearly has a broader scope than just this.

> Trying to guess how an OS will react and working around that is only
> going to cause problems when that OS changes over time.

True, but in some cases we are the ones who can control and/or predict
the evolution of both the OS and the u-boot development. I believe
that's exactly the case with the community maintained legacy sunxi-3.4
kernel.

> > I can see only one theoretically problematic scenario, where u-boot is
> > provided with the non-FDT and non-FEX blob, but loads a kernel, which
> > has FDT statically compiled in. How does this actually play with PSCI?
> 
> It would be completely orthogonal, just as the presence or absence of a
> DTB is orthogonal to the presence or absence of PSCI
> 
> > And what about the new device drivers model, which is going to depend
> > on FDT information itself? Are we really happy allowing to use different
> > FDT blobs for the u-boot and the kernel in the same system?
> 
> There are already differences between what U-Boot needs to know and the
> kernel needs to know, e.g. secure peripherals if the kernel is booted in
> a non-secure mode. So in general you might need separate DTBs; the
> physical address spaces are different.

Sounds like this may be a hell to maintain and keep working nicely
together

> > Or have I missed something?
> > 
> > Either way, following the least surprise principle, IMHO u-boot should
> > log the reason for making a decision about whether it is switching to
> > the non-secure mode or not. This is useful for troubleshooting.
> 
> Printing a message would make sense regardless of how the mode is
> selected.
> 
> Thanks,
> Mark.

Thanks for the explanations.

-- 
Best regards,
Siarhei Siamashka

  reply	other threads:[~2014-10-16  2:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 10:13 [U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems Hans de Goede
2014-10-15 10:18 ` Marc Zyngier
2014-10-15 10:25   ` Albert ARIBAUD
2014-10-15 10:43     ` Marc Zyngier
2014-10-15 10:25 ` Siarhei Siamashka
2014-10-15 10:31   ` Marc Zyngier
2014-10-15 10:40     ` Siarhei Siamashka
2014-10-15 12:42       ` Marc Zyngier
2014-10-15 14:05         ` Siarhei Siamashka
2014-10-15 14:39           ` Mark Rutland
2014-10-16  2:30             ` Siarhei Siamashka [this message]
2014-10-15 16:40           ` Marc Zyngier
2014-10-16  2:13             ` Siarhei Siamashka
2014-10-16  9:28 ` [U-Boot] " Hans de Goede

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=20141016053038.53368d1a@i7 \
    --to=siarhei.siamashka@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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