From: Daniele Alessandrelli <daniele.alessandrelli@linux.intel.com>
To: Pavel Machek <pavel@denx.de>
Cc: "arnd@arndb.de" <arnd@arndb.de>,
"robh@kernel.org" <robh@kernel.org>,
"Murphy, Paul J" <paul.j.murphy@intel.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"Shevchenko, Andriy" <andriy.shevchenko@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] soc: keembay: Add Keem Bay IMR driver
Date: Thu, 28 May 2020 14:00:29 +0100 [thread overview]
Message-ID: <b674e0b3900c4ac6b9a67cf9e041c642c0639679.camel@linux.intel.com> (raw)
In-Reply-To: <20200528112231.GA22054@duo.ucw.cz>
On Thu, 2020-05-28 at 13:22 +0200, Pavel Machek wrote:
> Hi!
>
> > > Agreed, this sounds like an incompatible extension of the boot
> > > protocol
> > > that we should otherwise not merge.
> > >
> > > However, there is also a lot of missing information here, and it
> > > is
> > > always
> > > possible they are trying to something for a good reason. As long
> > > as
> > > the
> > > problem that the bootloader is trying to solve is explained well
> > > enough
> > > in the changelog, we can discuss it to see how it should be done
> > > properly.
> >
> > Apologies, I should have provided more information. Here it is :)
> >
> > Basically, at boot time U-Boot code and core memory (.text, .data,
> > .bss, etc.) is protected by this Isolated Memory Region (IMR) which
> > prevents any device or processing units other than the ARM CPU to
> > access/modify the memory.
> >
> > This is done for security reasons, to reduce the risks that a
> > potential
> > attacker can use "hijacked" HW devices to interfere with the boot
> > process (and break the secure boot flow in place).
>
> Dunno. You disable that after boot anyway. Whether it is disabled
> just before starting kernel or just after it makes very little
> difference.
Not sure I get your point. Disabling it while U-Boot is still running
poses a security risk (even if arguably tiny), while doing it once the
the Kernel is running is totally safe. So, I'd prefer to do it in the
Kernel, unless practical reasons prevent it.
>
> Plus, I'm not sure if this has much security value at all. If I can
> corrupt data u-boot works _with_ (such as kernel, dtb), I'll take
> over the system anyway.
True, U-Boot data needs to be protected too and, in fact, we're trying
to do that as well. Other IMRs are used to protect the kernel, dtb, and
other critical memory sections.
>
> IOW I believe the best/simplest way is to simply disable this in
> u-boot before jumping to kernel entrypoint.
Yes, that's definitely the simplest solution, but, IMO, not the safest
one. So, I'd prefer to build on your initial suggestion and Arnd's
advice and create a new device driver to disable the IMR once Linux is
running. But, yes, if that eventually proves unfeasible, I might just
have the bootloader disable the protection right before booting the OS.
>
> Best regards,
>
> Pavel
>
next prev parent reply other threads:[~2020-05-28 13:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 16:36 [PATCH 0/1] Add IMR driver for Keem Bay Daniele Alessandrelli
2020-04-21 16:36 ` [PATCH 1/1] soc: keembay: Add Keem Bay IMR driver Daniele Alessandrelli
2020-05-01 8:10 ` Greg Kroah-Hartman
2020-05-01 11:50 ` Daniele Alessandrelli
2020-05-01 11:59 ` Greg Kroah-Hartman
2020-05-24 21:28 ` Pavel Machek
2020-05-25 8:18 ` Arnd Bergmann
2020-05-27 13:31 ` Alessandrelli, Daniele
2020-05-27 14:33 ` Arnd Bergmann
2020-05-27 17:43 ` Daniele Alessandrelli
2020-05-27 18:59 ` Arnd Bergmann
2020-05-28 12:27 ` Daniele Alessandrelli
2020-05-28 11:22 ` Pavel Machek
2020-05-28 13:00 ` Daniele Alessandrelli [this message]
2020-05-07 17:44 ` Pavel Machek
2020-04-30 19:49 ` [PATCH 0/1] Add IMR driver for Keem Bay Alessandrelli, Daniele
2020-05-01 7:09 ` gregkh
2020-05-01 7:53 ` Daniele Alessandrelli
2020-05-01 8:04 ` gregkh
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=b674e0b3900c4ac6b9a67cf9e041c642c0639679.camel@linux.intel.com \
--to=daniele.alessandrelli@linux.intel.com \
--cc=andriy.shevchenko@intel.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.j.murphy@intel.com \
--cc=pavel@denx.de \
--cc=robh@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
Powered by JetHome