From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
To: Andrew Tropin <andrew@trop.in>
Cc: "Jacopo Mondi" <jacopo.mondi@ideasonboard.com>,
72828@debbugs.gnu.org, "Ludovic Courtès" <ludo@gnu.org>
Subject: bug#72828: Grafting breaks libcamera signatures
Date: Thu, 5 Sep 2024 08:56:54 +0200 [thread overview]
Message-ID: <nux26yyisniy2blhue6nadbgeufbnqmzm5gf7pnf3jefy275dm@nulvs2l46fwy> (raw)
In-Reply-To: <87ed5zwc1y.fsf@trop.in>
[-- Attachment #1: Type: text/plain, Size: 4095 bytes --]
Hi Andrew, Ludovic,
On Wed, Sep 04, 2024 at 09:42:17PM GMT, Andrew Tropin wrote:
> On 2024-09-04 18:42, Ludovic Courtès wrote:
>
> > Hi Jacopo,
> >
> > Jacopo Mondi <jacopo.mondi@ideasonboard.com> skribis:
> >
> >> Not exactly. In libcamera, apart from creating a library to ease all
> >> the camera stack plumbing, we're creating an ecosystem of open-source
> >> 3A algorithms (what we call the IPA modules).
> >>
> >> Camera vendors and ODMs which invested in products with specific
> >> camera features, consider 3A algorithms and their tuning their secret
> >> sauce and are usually not willing to consider releasing them as open
> >> source with, fortunately, notable exceptions such as RaspberryPi
> >>
> >> Please note that all the platforms libcamera supports have an
> >> open-source 3A algorithm module available part of the main code base,
> >> and we consider open source 3A modules our 'first class citizens' and
> >> we're willing to develop and maintain them in libcamera mainline
> >> branch as free software, but at this point we have to provide a way for
> >> third-parties to load binary modules if they want to.
> >>
> >> The alternative is to have them continue developing camera stacks
> >> fully behind closed doors as it has been done so far.
> >
> > OK, I see, thanks for explaining the context.
> >
> >> As said, modules not built against the libcamera sources will not be
> >> signed, as they are distributed by other means by a vendor in binary
> >> form. To establish if a module has been built with the libcamera
> >> sources or not, we sign it during the build with a volatile key and
> >> validate the signature at run-time, when the IPA module is loaded.
> >>
> >> IPA modules for which the signature is not valid (either because they
> >> are distributed as binaries or, as in this case, because the build
> >> system strips symbols before installing the objects) are loaded in an
> >> isolated process and instead of being operated with direct function
> >> calls, we have implemented an IPC mechanism to communicate with them.
> >> This path is way less tested by our regular users and in our daily
> >> work on libcamera. Vendors that are running their binaries as isolated
> >> might have fixed issues here and there but maybe they have not
> >> reported the issue and the associated fix upstream (we have no control
> >> over this).
> >>
> >> For this reason I don't suggest running modules as isolated, even more
> >> if you have no reasons to do so. If all it takes is re-signing IPA modules
> >> after stripping them as Andrew did I would really consider doing that.
> >
> > Yeah, got it. The other option, with the understanding that IPA modules
> > are all going to be free software here, would be to dismiss both the
> > authentication and the isolation mechanism, possibly with a custom
> > patch. It seems like the change wouldn’t be too intrusive and it would
> > solve the problem for “grafts” as well (grafts modify files in a
> > non-functional way).
>
> On 2024-09-02 10:45, Andrew Tropin via Bug reports for GNU Guix wrote:
> > Anyway, I think the current most reasonable solution is to remove
> > signing step at all, because the signaturs will be invalidated by
> > grafting anyway and make it work somehow (either by loading in
> > isolation if it's possible or by loading unsigned libraries without
> > signature check directly).
>
> Everything indicates that we need to disable module authentication.
>
> Jacopo, I think I'll patch IPAManager::isSignatureValid to always return
> true.
>
> https://git.libcamera.org/libcamera/libcamera.git/tree/src/libcamera/ipa_manager.cpp#n285
>
> Like that:
>
>
> Everyone is ok with it?
At this point is a distro decision, either if you prefer to carry an
out-of-tree patch in your tree or tweak the build system.
Be aware that, sooner or later, the signature mechanism will be reworked and
your custom patch might not apply anymore.
Up to you :)
>
> --
> Best regards,
> Andrew Tropin
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2024-09-05 7:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 10:46 bug#72828: Grafting breaks libraries signatures Andrew Tropin via Bug reports for GNU Guix
2024-08-31 19:36 ` bug#72828: libcamera module signatures Ludovic Courtès
2024-09-02 6:45 ` Andrew Tropin via Bug reports for GNU Guix
2024-09-02 8:37 ` bug#72828: Grafting breaks libcamera signatures Jacopo Mondi
2024-09-04 16:42 ` Ludovic Courtès
2024-09-04 17:42 ` Andrew Tropin via Bug reports for GNU Guix
2024-09-05 6:46 ` Andrew Tropin via Bug reports for GNU Guix
2024-09-05 6:56 ` Jacopo Mondi [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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=nux26yyisniy2blhue6nadbgeufbnqmzm5gf7pnf3jefy275dm@nulvs2l46fwy \
--to=jacopo.mondi@ideasonboard.com \
--cc=72828@debbugs.gnu.org \
--cc=andrew@trop.in \
--cc=ludo@gnu.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).