From: Eric Biggers <ebiggers@kernel.org>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: linux-crypto@vger.kernel.org, David Howells <dhowells@redhat.com>,
Blaise Boscaccy <bboscaccy@linux.microsoft.com>
Subject: Re: [PATCH v3 0/5] pkcs7: better handling of signed attributes
Date: Thu, 5 Mar 2026 13:40:14 -0800 [thread overview]
Message-ID: <20260305214014.GB64054@quark> (raw)
In-Reply-To: <124016e6aa10434b73391cdccd95c69242f8e4de.camel@HansenPartnership.com>
On Thu, Mar 05, 2026 at 03:18:09PM -0500, James Bottomley wrote:
> On Thu, 2026-03-05 at 10:51 -0800, Eric Biggers wrote:
> > On Thu, Mar 05, 2026 at 09:46:42AM -0500, James Bottomley wrote:
> > > On Wed, 2026-03-04 at 23:55 -0800, Eric Biggers wrote:
> > > > On Thu, Feb 26, 2026 at 07:43:54AM -0500, James Bottomley wrote:
> > > > > > If this is for some out-of-tree module, we don't do that.
> > > > > >
> > > > > > I'll also note that we should generally be aiming to simplify
> > > > > > the PKCS#7 signature verification code, not making it even
> > > > > > more complex.
> > > > >
> > > > > I'm fine with the general goal, but since the current code
> > > > > verifies the signature, pulls out the message hash and other
> > > > > attributes, compares the message against the MessageDigest one
> > > > > and then frees the whole structure it's a bit hard to see how
> > > > > the current goal can be achieved without extracting at least
> > > > > the first part of that
> > > > > ...
> > > > > but if you have suggestion, I'm happy to implement.
> > > >
> > > > Sure, just incorporate your auxiliary data into the actual
> > > > message being signed and verified. Something like:
> > > >
> > > > program_len || program || hash*
> > >
> > > We can't do that because the second hash is for the LSM. If
> > > there's no LSM then we need the signature to pass the current eBPF
> > > signature check because the second hash will be verified by the
> > > loader, which means the program hash and nothing else must be in
> > > the messageDigest attr.
> > >
> >
> > Why does the loader need to verify the signature if the kernel has to
> > do it anyway, and why does the loader need to skip verifying the
> > maps?
>
> Well, I didn't say kernel, I said LSM. The problem is that the last
> hook in the LSM chain for eBPF loading occurs before the loader has
> actually run. This means that either the LSM needs to be assured
> verification will complete (by running it itself), which is what the
> patch set I pointed to does; or that we need an additional verification
> hook in eBPF somewhere in the verifier after the loader has run, which
> the eBPF people are looking at but haven't actually found anything yet.
>
> The OID helps the LSM do the additional verification without changing
> any of the eBPF loading flow.
LSMs are part of the kernel.
Not sure I follow. How can the kernel verify something before it's been
loaded into the kernel?
- Eric
next prev parent reply other threads:[~2026-03-05 21:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 21:19 [PATCH v3 0/5] pkcs7: better handling of signed attributes James Bottomley
2026-02-25 21:19 ` [PATCH v3 1/5] certs: break out pkcs7 check into its own function James Bottomley
2026-02-25 21:19 ` [PATCH v3 2/5] crypto: pkcs7: add flag for validated trust on a signed info block James Bottomley
2026-02-25 21:19 ` [PATCH v3 3/5] crypto: pkcs7: allow pkcs7_digest() to be called from pkcs7_trust James Bottomley
2026-02-26 20:31 ` Eric Biggers
2026-02-27 3:50 ` James Bottomley
2026-03-05 7:58 ` Eric Biggers
2026-03-05 14:53 ` James Bottomley
2026-03-05 18:50 ` Eric Biggers
2026-03-05 20:11 ` James Bottomley
2026-03-05 21:36 ` Eric Biggers
2026-03-05 22:06 ` James Bottomley
2026-02-25 21:19 ` [PATCH v3 4/5] crypto: pkcs7: add ability to extract signed attributes by OID James Bottomley
2026-02-25 21:19 ` [PATCH v3 5/5] crypto: pkcs7: add tests for pkcs7_get_authattr James Bottomley
2026-02-26 1:12 ` kernel test robot
2026-02-26 2:13 ` [PATCH v3 0/5] pkcs7: better handling of signed attributes Eric Biggers
2026-02-26 12:43 ` James Bottomley
2026-03-05 7:55 ` Eric Biggers
2026-03-05 14:46 ` James Bottomley
2026-03-05 18:51 ` Eric Biggers
2026-03-05 20:18 ` James Bottomley
2026-03-05 21:40 ` Eric Biggers [this message]
2026-03-05 22:11 ` James Bottomley
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=20260305214014.GB64054@quark \
--to=ebiggers@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=bboscaccy@linux.microsoft.com \
--cc=dhowells@redhat.com \
--cc=linux-crypto@vger.kernel.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.
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.