All of lore.kernel.org
 help / color / mirror / Atom feed
From: Moiz Imtiaz <moizimtiaz1@gmail.com>
To: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>,
	Mark Kettenis <mark.kettenis@xs4all.nl>,
	 U-Boot Mailing List <u-boot@lists.denx.de>,
	Moiz Imtiaz Khan <moiz.imtiaz@skyelectric.com>,
	 Jehannaz Khan <jehannazkhan@skyelectric.com>
Subject: Re: Problem with U-boot | Configuration Signature not being checked while booting
Date: Sat, 18 Sep 2021 14:47:51 +0500	[thread overview]
Message-ID: <CAMHoVnr__RK87T5PakFK+XR+oQVz5_6w=N5shZhPHi3LdZJwhw@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ27Q5zXOyjRZH9uwGUOXmUf9vZk=XGxFkdEgGd5CnjaVQ@mail.gmail.com>

>Nice!  If you want to write something up extending the >documentation on
>how you made this work for Pi it would be much appreciated.

Sure, would love to do a PR.

I basically replaced the dtb that pi loads with control Dtb of uboot, but
will do a PR of documentation addition in respect to pi_4, detailing
everything shortly :)

It does verifies the kernel, and other loadables, except (Dtb) because this
is what Pi is giving to Uboot , not sure whether at "starting kernel" stage
Uboot passes its own Dtb (verified one) or  the one passed by pi
(unverified/ can't be verified, as it gets passed to Uboot by pi). So in
true sense it's not a complete secure boot. Plus Pi_4 doesn't implement the
trustzone that Armv8 provides (Cortex A-72 ) so I am not sure how difficult
it would be for someone to change the config.txt(kernel=u-boot.bin) in
memory (from attackers perspective), resulting in normal pi bootloader to
be loaded rather  Uboot on next reboot.

If pi can make the config.txt immutable from memory , have kind of secure
world, than it would be great. Not sure, if pi has something as of this in
mind in near future implementation either.

On Sat, 18 Sep 2021, 14:28 Simon Glass, <sjg@chromium.org> wrote:

> Hi Tom,
>
> On Fri, 17 Sept 2021 at 11:26, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Fri, Sep 17, 2021 at 10:19:18AM -0600, Simon Glass wrote:
> > > Hi Mark,
> > >
> > > On Wed, 15 Sept 2021 at 05:52, Mark Kettenis <mark.kettenis@xs4all.nl>
> wrote:
> > > >
> > > > > From: Simon Glass <sjg@chromium.org>
> > > > > Date: Wed, 15 Sep 2021 04:13:24 -0600
> > > >
> > > > Hi Simon,
> > > >
> > > > > Hi Mark,
> > > > >
> > > > > On Sat, 11 Sept 2021 at 13:18, Mark Kettenis <
> mark.kettenis@xs4all.nl> wrote:
> > > > > >
> > > > > > > From: Moiz Imtiaz <moizimtiaz1@gmail.com>
> > > > > > > Date: Sat, 11 Sep 2021 23:19:05 +0500
> > > > > > >
> > > > > > > Hi Simon,
> > > > > > >
> > > > > > > Thanks for the reply.  I already followed the steps mentioned
> in
> > > > > > > "doc/uImage.FIT/beaglebone_vboot.txt".
> > > > > > >
> > > > > > > >I wonder if rpi is not using the devicetree compiled with
> U-Boot, but
> > > > > > > instead one provided by the earlier-stage firmware?
> > > > > > >
> > > > > > > Not sure, but seems like this is the case. I checked and there
> isn't any
> > > > > > > dtb or dts for rpi4 (bcm2711-rpi-4-b) in arc/arm/dts in
> u-boot. I tried to
> > > > > > > add the dtb and other dts dtsi
> > > > > > > <
> https://github.com/raspberrypi/linux/tree/rpi-5.10.y/arch/arm64/boot/dts/broadcom
> >files
> > > > > > > from the raspberry pi Linux and compile them with
> CONFIG_OF_SEPARATE and
> > > > > > > CONFIG_OF_EMBED (one at a time) *but it couldn't even boot the
> U-Boot and
> > > > > > > it would just give a blank screen*. I wonder why there isn't
> any device
> > > > > > > tree in the U-boot repo for RPI4. Is U-boot control FDT not
> supported by
> > > > > > > RPI4?
> > > > > >
> > > > > > The issue with the rpi4 is that the addresses of devices move
> around
> > > > > > based on the version of the Raspberry Pi firmware you're using.
> And
> > > > > > possibly on the amount of memory on the board as well.  So U-Boot
> > > > > > pretty much has to use the device tree passed by the firmware
> since
> > > > > > the device tree in the U-Boot tree would be wrong for many
> > > > > > combinations of firmware and hardware.
> > > > > >
> > > > > > Simon, this sort of thing is exactly the reason why I think the
> idea
> > > > > > of having all U-Boot configuration information in a single
> device tree
> > > > > > with the hardware description doesn't work everywhere.
> > > > >
> > > > > >From my reading of this thread, it rather reinforces the need to
> > > > > provide a way to give U-Boot the config it needs, in the
> devicetree.
> > > >
> > > > As long as that configuration is optional, yes, maybe.
> > > >
> > > > > It seems that rpi is actually OK in this regard. If you think about
> > > > > it, it would be pretty hopeless if first-stage firmware assumed
> that
> > > > > it could provide a devicetree to whatever is next.
> > > >
> > > > Not hopeless.  If that device tree provides a hardware description
> > > > that is complete enough to boot Linux, it should be good enough to
> run
> > > > U-Boot.
> > >
> > > Not in general. I hope I have covered this in enormous detail in the
> > > devicetree patch. But if you don't need verified boot, SPL or some
> > > other feature that needs config, then perhaps you will get away with
> > > it.
> >
> > Wait, why does SPL _need_ it?  If something provides us with a device
> > tree, we don't need u-boot,dm-spl as that's used to filter nodes in to a
> > smaller DT to use.
>
> Yes, although if the filtering is not done I am not sure what SPL
> would do. In fact we don't have a way to provide two DTs (SPL, U-Boot
> proper) from a prior boot stage at present.
>
> >  Dealing with u-boot,dm-pre-reloc could be trickier,
> > but means whatever loaded us needs to have enabled any early clocks we
> > need.  But even then, it's just going to be output related?  And some
> > "was already configured" path could be used.
>
> My point is that ignoring U-Boot's devicetree requirements doesn't
> work in general. It may work in specific cases. It cannot work for
> verified boot of course.
>
> Regards,
> Simon
>

  reply	other threads:[~2021-09-18  9:48 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 20:21 Problem with U-boot | Configuration Signature not being checked while booting Moiz Imtiaz
2021-09-10  4:37 ` Simon Glass
2021-09-11 18:19   ` Moiz Imtiaz
2021-09-11 19:18     ` Mark Kettenis
2021-09-11 21:05       ` Tom Rini
2021-09-11 21:30         ` Mark Kettenis
2021-09-11 21:34           ` Tom Rini
2021-09-11 21:58             ` Moiz Imtiaz
2021-09-12 15:02               ` Tom Rini
2021-09-12 20:45                 ` Moiz Imtiaz
2021-09-15 13:02                   ` Tom Rini
2021-09-15 10:13       ` Simon Glass
2021-09-15 10:25         ` François Ozog
2021-09-17 16:21           ` Simon Glass
2021-09-17 17:18             ` François Ozog
2021-09-17 17:55             ` Tom Rini
2021-09-15 11:51         ` Mark Kettenis
2021-09-15 13:35           ` Tom Rini
2021-09-15 13:53             ` François Ozog
2021-09-17 16:21             ` Simon Glass
2021-09-17 17:42               ` Tom Rini
2021-09-18  9:27                 ` Simon Glass
2021-09-18 13:24                   ` Tom Rini
2021-09-17 16:19           ` Simon Glass
2021-09-17 17:26             ` Tom Rini
2021-09-18  9:27               ` Simon Glass
2021-09-18  9:47                 ` Moiz Imtiaz [this message]
2021-09-18 10:10                   ` Mark Kettenis
2021-09-18 10:26                     ` François Ozog
2021-09-18 13:24                       ` Moiz Imtiaz
2021-09-18 13:30                         ` Moiz Imtiaz
2021-09-20 15:33                       ` Tom Rini
2021-09-18 11:15                 ` Mark Kettenis
2021-09-18 15:28                   ` Simon Glass
2021-09-20 15:38                   ` Tom Rini
2021-09-20 15:27                 ` Tom Rini

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='CAMHoVnr__RK87T5PakFK+XR+oQVz5_6w=N5shZhPHi3LdZJwhw@mail.gmail.com' \
    --to=moizimtiaz1@gmail.com \
    --cc=jehannazkhan@skyelectric.com \
    --cc=mark.kettenis@xs4all.nl \
    --cc=moiz.imtiaz@skyelectric.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.