From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] sunxi: Increase SPL header size to 64 bytes to avoid code corruption
Date: Thu, 2 Jun 2016 17:57:21 +0300 [thread overview]
Message-ID: <20160602175721.4a41bd20@i7> (raw)
In-Reply-To: <c0a3568c-9308-8541-8e75-5c5f1d38780c@redhat.com>
On Mon, 16 May 2016 19:52:33 +0200
Hans de Goede <hdegoede@redhat.com> wrote:
> Hi,
>
> On 16-05-16 11:56, Bernhard Nortmann wrote:
> > Given that there now are quite a few additional "reserved" entries, and while we're still at SPL_HEADER_VERSION 1, I'd like to renew my request of dedicating one of these fields to the script length - which would enable us to set the U-Boot ${filesize} accordingly.
> >
> > i.e.
> > --- arch-arm-include-asm-arch-sunxi-spl.h
> > +++ arch-arm-include-asm-arch-sunxi-spl.new.h
> > @@ -49,7 +49,8 @@
> > uint8_t spl_signature[4];
> > };
> > uint32_t fel_script_address;
> > - uint32_t reserved1[3];
> > + uint32_t fel_script_length;
> > + uint32_t reserved1[2];
> > uint32_t boot_media; /* written here by the boot ROM */
> > uint32_t reserved2[5]; /* padding, align to 64 bytes */
> > };
> >
> >
> > I do not intend to further push my specific use cases, however I still consider the (then somewhat theoretical) ability to do "import -t ${fel_script_addr} ${filesize}" useful. For reference, the previous discussion related to this was somewhere around http://lists.denx.de/pipermail/u-boot/2015-September/227454.html
>
> Hmm, given that the boot-rom touches some of these, I wonder if
> we should be putting anything here at all.
Yes, this came as a bit of surprise because this was not clearly
documented anywhere. Still it looks like that's just a single
byte getting modified, albeit at a bit strange location.
BTW, do you remember what I said earlier about not always being in
perfect control?
http://lists.denx.de/pipermail/u-boot/2015-September/228727.html
This particular issue just serves as a very nice demonstration :-)
Anyway, I think that we are already reasonably well prepared to handle
it. The worst thing that can happen is that the boot ROM in the future
Allwinner SoCs starts patching even more bytes in the header or moves
this boot device id variable to some other address. If/when this
happens, we can always update the SPL header format (do the "major"
version change trick).
> Other then that worry, I see no problem with adding a
> fel_script_length, Siarhei what is your opinion on this ?
I personally have no objections.
--
Best regards,
Siarhei Siamashka
next prev parent reply other threads:[~2016-06-02 14:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-14 1:13 [U-Boot] [PATCH v2] sunxi: Increase SPL header size to 64 bytes to avoid code corruption Siarhei Siamashka
2016-05-15 10:04 ` Hans de Goede
2016-05-16 9:56 ` Bernhard Nortmann
2016-05-16 17:52 ` Hans de Goede
2016-06-02 14:57 ` Siarhei Siamashka [this message]
2016-06-03 7:30 ` Bernhard Nortmann
2016-06-03 10:53 ` Hans de Goede
2016-06-04 17:12 ` [U-Boot] [PATCH] sunxi: Add the ability to pass (script) filesize in the SPL header Bernhard Nortmann
2016-06-05 11:44 ` Siarhei Siamashka
2016-06-05 13:01 ` Bernhard Nortmann
2016-06-06 9:20 ` Siarhei Siamashka
2016-06-07 14:09 ` Bernhard Nortmann
2016-06-07 17:14 ` Siarhei Siamashka
2016-06-08 18:23 ` [U-Boot] [PATCH v2] sunxi: Add the ability to recognize and auto-import uEnv-style data Bernhard Nortmann
2016-06-08 20:13 ` Hans de Goede
2016-06-08 21:29 ` Bernhard Nortmann
2016-06-09 0:14 ` Siarhei Siamashka
2016-06-09 5:37 ` [U-Boot] [PATCH v3] sunxi: FEL - " Bernhard Nortmann
2016-06-10 19:31 ` [U-Boot] [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=20160602175721.4a41bd20@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