All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
To: Frank Rowand <frowand.list@gmail.com>
Cc: Rob Herring <robherring2@gmail.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	David Gibson <david@gibson.dropbear.id.au>,
	Tom Rini <trini@konsulko.com>,
	Franklin S Cooper Jr <fcooper@ti.com>,
	Matt Porter <mporter@konsulko.com>,
	Simon Glass <sjg@chromium.org>,
	Phil Elwell <philip.j.elwell@gmail.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Marek Vasut <marex@denx.de>,
	Devicetree Compiler <devicetree-compiler@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] yamldt v0.5, now a DTS compiler too
Date: Mon, 9 Oct 2017 17:59:04 +0300	[thread overview]
Message-ID: <3D2E2DE3-3A5E-4185-852D-C91A70EA62F7@konsulko.com> (raw)
In-Reply-To: <59DAAFD3.9070900@gmail.com>

Hi Frank,

> On Oct 9, 2017, at 02:08 , Frank Rowand <frowand.list@gmail.com> wrote:
> 
> On 10/07/17 03:23, Pantelis Antoniou wrote:
>> Hi Rob,
>> 
>>> On Oct 6, 2017, at 16:55 , Rob Herring <robherring2@gmail.com> wrote:
>>> 
>>> On Tue, Oct 3, 2017 at 12:39 PM, Pantelis Antoniou
>>> <pantelis.antoniou@konsulko.com> wrote:
>>>> Hi Rob,
> 
> < snip >
> 
>>>> eBPF is portable, can be serialized after compiling in the schema file
>>>> and can be executed in the kernel.
>>> 
>>> Executing in the kernel is a non-goal for me.
> 
> Executing in the kernel is an anti-goal for me.
> 
> We are trying to reduce the device tree footprint inside the kernel,
> not increase it.
> 
> 99.99% of the validation should be possible statically, in the compile
> phase.
> 

That’s not possible when you dynamically alter the tree at runtime.

> 
>>>> By stripping out all documentation related properties and nodes keeping
>>>> only the compiled filters you can generate a dtb blob that passed to
>>>> kernel can be used for verification of all runtime changes in the
>>>> kernel's live tree. eBPF is enforcing an execution model that is 'safe'
>>>> so we can be sure that no foul play is possible.
> 
> Run time changes can be assumed correct (short of bugs in the overlay
> application code), if the base tree is validated, the overlay is validated,
> and the interface between the live tree and the overlay is a connector.
> 

You can validate the base tree statically but not the overlays.

In fact a large percentage of overlay usage simply modifies a status property
to turn on or off a device. There is nothing to validate in such case.

The portable connector is still a long ways off and I haven’t seen anything that
could handle something trickier that a few GPIOs and I2C or SPI busses.

My goal is something that works covering all the cases without any surprising
gotchas.

> 
>>> Humm, if you wanted to ensure dtb's are safe, I'd think that we just
>>> sign them like you would for the kernel or modules.
>>> 
>> 
>> That’s a problem when deploying; the runtime validation is for making sure
>> developers don’t get bogged down chasing problems when working on their
>> own platforms/drivers.
>> 
>> We have absolutely zero checks for stopping badly configured DT blobs
>> hanging the kernel. With runtime validation a bug that might take a few
>> days to figure out can be cut down to a few minutes.
> 
> Same reply as above.
> 
> 
>>>> That means that you can a) run it at boot-time, verifying the dtb blob
>>>> passed by the bootloader for errors (potentially disabling devices
>>>> that their nodes fail) and b) run it when applying overlays to reject
>>>> any that result in an invalid tree.
>>> 
>>> Let's get verification at build time working first, then we can worry
>>> about something like this.
> 
> < snip >
> 

Right, let’s get build verification working first.

> -Frank

Regards

— Pantelis

  parent reply	other threads:[~2017-10-09 14:59 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-28 19:58 [RFC] yamldt v0.5, now a DTS compiler too Pantelis Antoniou
2017-09-28 19:58 ` Pantelis Antoniou
2017-10-01 22:00 ` Rob Herring
2017-10-01 22:00   ` Rob Herring
2017-10-02  7:36   ` Pantelis Antoniou
2017-10-02 19:46   ` Pantelis Antoniou
2017-10-03  7:17     ` Geert Uytterhoeven
2017-10-03  7:33       ` Pantelis Antoniou
2017-10-03 13:18     ` Rob Herring
2017-10-03 14:13       ` Pantelis Antoniou
2017-10-03 14:13         ` Pantelis Antoniou
2017-10-03 17:13         ` Rob Herring
2017-10-03 17:39           ` Pantelis Antoniou
2017-10-03 17:39             ` Pantelis Antoniou
2017-10-06 13:55             ` Rob Herring
2017-10-06 13:55               ` Rob Herring
2017-10-07 10:23               ` Pantelis Antoniou
2017-10-08 23:08                 ` Frank Rowand
2017-10-08 23:08                   ` Frank Rowand
2017-10-09  0:00                   ` David Gibson
2017-10-09  0:00                     ` David Gibson
2017-10-09 15:07                     ` Pantelis Antoniou
2017-10-09 15:07                       ` Pantelis Antoniou
2017-10-10  1:50                       ` David Gibson
2017-10-10 15:19                         ` Pantelis Antoniou
2017-10-10 15:19                           ` Pantelis Antoniou
2017-10-11  3:49                           ` David Gibson
2017-10-11  3:49                             ` David Gibson
2017-10-09 14:59                   ` Pantelis Antoniou [this message]
2017-10-20 17:46 ` Grant Likely
2017-10-20 17:46   ` Grant Likely
2017-10-20 19:16   ` Pantelis Antoniou
2017-10-22 17:54     ` Grant Likely
2017-10-22 17:54       ` Grant Likely
2017-10-22 18:23       ` Pantelis Antoniou
2017-10-22 18:23         ` Pantelis Antoniou
2017-10-22 19:13         ` Grant Likely
2017-10-22 19:13           ` Grant Likely
2017-10-23 10:08           ` Pantelis Antoniou
2017-10-23 10:08             ` Pantelis Antoniou

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=3D2E2DE3-3A5E-4185-852D-C91A70EA62F7@konsulko.com \
    --to=pantelis.antoniou@konsulko.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=devicetree-compiler@vger.kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fcooper@ti.com \
    --cc=frowand.list@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=mporter@konsulko.com \
    --cc=philip.j.elwell@gmail.com \
    --cc=robherring2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    /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.