All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/4] Introduce CONFIG_SPL_ABORT_ON_NON_FIT_IMAGE
Date: Wed, 8 Feb 2017 09:18:22 -0600	[thread overview]
Message-ID: <98948698-40c4-c8aa-af4e-9d050104c4ec@ti.com> (raw)
In-Reply-To: <CAPnjgZ0dTfHw-Kc7S7zfUehLfwmcA3MqFYoi9VQAYftM_ysy-g@mail.gmail.com>

On 12/06/2016 09:47 PM, Simon Glass wrote:
> Hi Andrew,
> 
> On 5 December 2016 at 17:37, Andrew F. Davis <afd@ti.com> wrote:
>> On 11/14/2016 06:33 PM, Simon Glass wrote:
>>> Hi Andrew,
>>>
>>> On 14 November 2016 at 15:05, Andrew F. Davis <afd@ti.com> wrote:
>>>> On 11/14/2016 02:44 PM, Simon Glass wrote:
>>>>> Hi Andrew,
>>>>>
>>>>> On 14 November 2016 at 12:14, Andrew F. Davis <afd@ti.com> wrote:
>>>>>> Introduce CONFIG_SPL_ABORT_ON_NON_FIT_IMAGE. An SPL which define
>>>>>> this will abort image loading if the image is not a FIT image.
>>>>>>
>>>>>> Signed-off-by: Andrew F. Davis <afd@ti.com>
>>>>>> ---
>>>>>>  Kconfig          | 9 +++++++++
>>>>>>  common/spl/spl.c | 5 +++++
>>>>>>  2 files changed, 14 insertions(+)
>>>>>>
>>>>>> diff --git a/Kconfig b/Kconfig
>>>>>> index 1263d0b..eefebef 100644
>>>>>> --- a/Kconfig
>>>>>> +++ b/Kconfig
>>>>>> @@ -291,6 +291,15 @@ config FIT_IMAGE_POST_PROCESS
>>>>>>           injected into the FIT creation (i.e. the blobs would have been pre-
>>>>>>           processed before being added to the FIT image).
>>>>>>
>>>>>> +config SPL_ABORT_ON_NON_FIT_IMAGE
>>>>>
>>>>> We already have CONFIG_IMAGE_FORMAT_LEGACY so how about
>>>>> CONFIG_SPL_IMAGE_FORMAT_LEGACY instead? It can default to y if secure
>>>>> boot is disabled.
>>>>>
>>>>
>>>> We also already have CONFIG_SPL_ABORT_ON_RAW_IMAGE on which this is
>>>> based. If we only disable legacy image support then RAW images should
>>>> still be allowed, but we will fail early anyway, we will start to need
>>>> an unmaintainable amount of pre-processor logic to to handle the
>>>> different image types and what is allowed/not allowed.
>>>>
>>>> Even worse some boot modes don't seem to support FIT images (net,
>>>> onenand) so these will alway expect legacy to work. Right now we simply
>>>> have to disable these modes.
>>>
>>> IMO CONFIG_SPL_ABORT_ON_RAW_IMAGE should become a positive option, to
>>> fit in with the legacy format. Otherwise we'll get very confused I
>>> think.
>>>
>>
>> I'm not sure what you are suggesting here, would you like
>>
>> CONFIG_SPL_SUPPORT_RAW_IMAGE
>> CONFIG_SPL_SUPPORT_LEGACY_IMAGE
>> CONFIG_SPL_SUPPORT_FIT_IMAGE
>>
>> And then we disable as needed? I'm not sure this will work in our case,
>> as a new image type may be introduced and enabled by default, this will
>> break our board security until we discover this and disabled it. The
>> benefit of a negative option for us is that we can specify we *only*
>> allow FIT, then it will be obvious to someone adding a new image type
>> they will not meet this check and should not put code outside this block.
> 
> I don't think we add new image types often, and they should default to
> n just as we do for U-Boot proper. Although something odd has happened
> with DISABLE_IMAGE_LEGACY.
> 
> his should of thing should be caught in a security review.
> 
> Also you could add something to print a warning if secure boot is
> enabled but insecure boot options are available? Perhaps that should
> be another option, and default to y?
> 
> It's just that it is really hard to deal with multiple negative
> options, so best avoided if we can.
> 

I agree in general, but this time I think this is hard to properly
avoid. All that would be different with a positive option only case
would be a bunch of checks that all other image modes are off, then
block undefining the same code I am here.

Andrew

> Regards,
> Simon
> 

  reply	other threads:[~2017-02-08 15:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-14 19:14 [U-Boot] [PATCH v2 0/4] Allow disabling non-FIT image loading from SPL Andrew F. Davis
2016-11-14 19:14 ` [U-Boot] [PATCH v2 1/4] Introduce CONFIG_SPL_ABORT_ON_NON_FIT_IMAGE Andrew F. Davis
2016-11-14 20:44   ` Simon Glass
2016-11-14 22:05     ` Andrew F. Davis
2016-11-15  0:33       ` Simon Glass
2016-12-05 22:37         ` Andrew F. Davis
2016-12-07  3:47           ` Simon Glass
2017-02-08 15:18             ` Andrew F. Davis [this message]
2017-02-10 16:23               ` Simon Glass
2017-02-10 16:57                 ` Andrew F. Davis
2016-11-14 19:14 ` [U-Boot] [PATCH v2 2/4] ARM: AM57xx: Disable non-FIT based image loading for HS devices Andrew F. Davis
2016-11-14 19:14 ` [U-Boot] [PATCH v2 3/4] ARM: AM437x: " Andrew F. Davis
2016-11-14 19:14 ` [U-Boot] [PATCH v2 4/4] ARM: DRA7xx: " Andrew F. Davis

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=98948698-40c4-c8aa-af4e-9d050104c4ec@ti.com \
    --to=afd@ti.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.