All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Pagani <marco.pagani@linux.dev>
To: Xu Yilun <yilun.xu@linux.intel.com>
Cc: Moritz Fischer <mdf@kernel.org>, Xu Yilun <yilun.xu@intel.com>,
	Tom Rix <trix@redhat.com>,
	linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] fpga: region: Add support for FPGA region variants
Date: Mon, 17 Aug 2026 18:14:34 +0200	[thread overview]
Message-ID: <8848432d-45b0-4efe-adf3-adfb64fe0899@linux.dev> (raw)
In-Reply-To: <aoJ6paA/8ndpJ17y@yilunxu-OptiPlex-7050>



On 17/08/2026 05:06, Xu Yilun wrote:
>>> But if the no-verification-in-driver is denied, I think the thing we
>>> need to do is to verify the binding between the DT description & image.
>>> After we've verified the DTO & the image is a valid pair, they are not
>>> arbitrary, whatever the DTO does is necessary to the updated hardware.
>>
>> I think we agree on this. Ideally, we should validate the complete
>> {config, image} pair. However, I don't see how using DTO at runtime can
>> help with this goal.
> 
> Validation is not the goal. Re-enumeration is the goal. DTO is what FPGA
> is now using for re-enumeration. Validation helps DTO if you want extra
> integrity.

I would argue that validation is a requirement for any userspace
interface, while I do agree that re-enumeration is the goal. In my RFC,
re-enumeration is triggered using the DT infrastructure every time
userspace switches from one variant to another. Variants can be thought
of as pre-validated DT fragments baked into the base DT, rather than
DTOs ingested from userspace at runtime.

To clarify my position, going back to a couple of messages ago:

- As I understand it, the current upstream consensus is that hardware
  devices must be responsible for verifying their own firmware.
  So, the kernel is responsible for protecting the integrity of its
  own configuration (live DT), while the reconfiguration engine is
  responsible for validating FPGA images;

- If this is not sufficient, and there is a requirement to secure
  /lib/firmware, it should be done at the filesystem level using
  the IMA subsystem;

- However, since not all FPGA reconfiguration engines support crypto
  image verification, and not all SoCs/platforms have a TPM IP or
  support for a TEE, we might consider having a subsystem-specific and
  optional check for the {config, image} pair as a *future* extension.


>> On the contrary, it would put us in a situation
>> where neither element of the pair is guaranteed since it enables the
>> user to feed arbitrarily forged DTOs.
> 
> As you referenced, no OS component (even the kernel) could guarantee the
> functionality of the binary for a device, only the device can. So what's
> the difference who provides the pair?
> 
> The only thing matters here is integrity and authentication, which is
> totally a different thing from kernel-user privilege.
> 
> I'm also confused you keep on telling that userspace is arbitrary so no
> userspace interface, which seems to suggest kenrel should never get any
> input from user.

My concern isn't about accepting user input in general but rather about
the type and scope of that input. I think there is a huge difference in
terms of the security between:

- matching a string that userspace sent via sysfs and then applying a
  safe configuration already contained in the base DT (validated from
  a FIT image).

- having userspace directly pass the kernel DT configuration (as a DTO),
  which the kernel must then validate (both syntactically and
  semantically) and apply.

In the first scenario, userspace is like a customer selecting from a
menu of pre-approved dishes, and then the kitchen safely prepares it.

In the second scenario, userspace is like a customer stepping into the
kitchen to cook their own meal, forcing the chef to constantly supervise
them to ensure they don't burn the place down.


>>> It is possible. To be more efficient, I think we should invite
>>> boarder discussions.

Following up on what you said two messages ago, I think we should invite
the DT people and ask for their input to help move this conversation
forward.


Thanks,
Marco

      reply	other threads:[~2026-08-17 16:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 16:42 [RFC PATCH] fpga: region: Add support for FPGA region variants Marco Pagani
2026-06-08 16:42 ` [RFC PATCH fpga/for-next 1/2] " Marco Pagani
2026-06-08 16:42 ` [RFC PATCH fpga/for-next 2/2] fpga: of-fpga-region: Add support for " Marco Pagani
2026-06-26 12:58 ` [RFC PATCH] fpga: region: Add support for FPGA " Xu Yilun
2026-06-30  9:39   ` Marco Pagani
2026-06-30 14:58     ` Xu Yilun
2026-07-06 10:05       ` Marco Pagani
2026-07-07  8:02         ` Xu Yilun
2026-07-07 21:49           ` Marco Pagani
2026-07-22 11:22             ` Xu Yilun
2026-08-02 21:32               ` Marco Pagani
2026-08-03  9:27                 ` Xu Yilun
2026-08-08 19:35                   ` Marco Pagani
2026-08-10  7:25                     ` Xu Yilun
2026-08-16 13:18                       ` Marco Pagani
2026-08-17  3:06                         ` Xu Yilun
2026-08-17 16:14                           ` Marco Pagani [this message]

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=8848432d-45b0-4efe-adf3-adfb64fe0899@linux.dev \
    --to=marco.pagani@linux.dev \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=trix@redhat.com \
    --cc=yilun.xu@intel.com \
    --cc=yilun.xu@linux.intel.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.