BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Daniel Borkmann" <daniel@iogearbox.net>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 04/11] bpftool: Support ML-DSA program signing
Date: Tue, 25 Aug 2026 14:36:30 +0000	[thread overview]
Message-ID: <20260825143630.86BF41F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260825142530.1329706-5-daniel@iogearbox.net>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Dropping `CMS_NOATTR` for ML-DSA without adding `CMS_NO_SIGNING_TIME` causes non-deterministic signatures, breaking reproducible builds for BPF skeletons.
--

--- Patch [4]: [PATCH bpf-next v2 04/11] bpftool: Support ML-DSA program signing ---
commit 1bfca914da9c400a3a2dbb7eb82099d6c8b92c8f
Author: Daniel Borkmann <daniel@iogearbox.net>

bpftool: Support ML-DSA program signing

This commit adds support for ML-DSA program signing in bpftool. It handles
OpenSSL versions that require signedAttrs by dropping the CMS_NOATTR flag
and bumps the maximum signature size to 16 KiB to accommodate larger ML-DSA
signatures.

> diff --git a/tools/bpf/bpftool/sign.c b/tools/bpf/bpftool/sign.c
> index 88726a6db6d0e..1b5502f48add0 100644
> --- a/tools/bpf/bpftool/sign.c
> +++ b/tools/bpf/bpftool/sign.c
[ ... ]
> @@ -167,6 +170,21 @@ int bpftool_prog_sign(struct bpf_load_and_run_opts *opts)
>  		goto cleanup;
>  	}
>  
> +#if OPENSSL_VERSION_NUMBER >= 0x30000000L && OPENSSL_VERSION_NUMBER < 0x40000000L
> +	if (EVP_PKEY_is_a(private_key, "ML-DSA-44") ||
> +	    EVP_PKEY_is_a(private_key, "ML-DSA-65") ||
> +	    EVP_PKEY_is_a(private_key, "ML-DSA-87")) {
> +		/*
> +		 * ML-DSA + CMS_NOATTR is not supported before openssl-4.0, so
> +		 * fall back to signedAttrs. ML-DSA does its own hashing and
> +		 * ignores the CMS digest, except when signedAttrs are used,
> +		 * where only SHA-512 is permitted.
> +		 */
> +		signer_flags &= ~CMS_NOATTR;

[Severity: Medium]
When CMS_NOATTR is cleared here, doesn't OpenSSL automatically include the
signingTime attribute by default?

If signingTime is included, this would cause the generated BPF signature to
change on every invocation. Could this break reproducible builds for projects
compiling signed BPF skeletons? Should CMS_NO_SIGNING_TIME be added to
signer_flags when CMS_NOATTR is cleared, similar to how scripts/sign-file.c
handles it?

> +		cms_digest = EVP_sha512();
> +	}
> +#endif
> +
>  	cms = CMS_sign(NULL, NULL, NULL, NULL,
>  		       CMS_NOCERTS | CMS_PARTIAL | CMS_BINARY | CMS_DETACHED |
>  			       CMS_STREAM);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260825142530.1329706-1-daniel@iogearbox.net?part=4

  reply	other threads:[~2026-08-25 14:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 14:25 [PATCH bpf-next v2 00/11] BPF keyring and signed loader ML-DSA support Daniel Borkmann
2026-08-25 14:25 ` [PATCH bpf-next v2 01/11] bpf: Add a bpf keyring for program signature validation Daniel Borkmann
2026-08-25 14:39   ` sashiko-bot
2026-08-25 14:25 ` [PATCH bpf-next v2 02/11] bpf: Refuse caller-supplied keyrings when the bpf one is active Daniel Borkmann
2026-08-25 14:25 ` [PATCH bpf-next v2 03/11] bpf: Raise the bound on a program's signature size Daniel Borkmann
2026-08-25 14:25 ` [PATCH bpf-next v2 04/11] bpftool: Support ML-DSA program signing Daniel Borkmann
2026-08-25 14:36   ` sashiko-bot [this message]
2026-08-25 14:25 ` [PATCH bpf-next v2 05/11] selftests/bpf: Add a test for the sealed bpf keyring Daniel Borkmann
2026-08-25 14:25 ` [PATCH bpf-next v2 06/11] selftests/bpf: Rebuild signed lskels when signing key changes Daniel Borkmann
2026-08-25 14:25 ` [PATCH bpf-next v2 07/11] selftests/bpf: Rename the verify_sig_setup.sh setup into setup-rsa Daniel Borkmann
2026-08-25 14:25 ` [PATCH bpf-next v2 08/11] selftests/bpf: Add an end-to-end ML-DSA signed loader test Daniel Borkmann
2026-08-25 14:25 ` [PATCH bpf-next v2 09/11] selftests/bpf: Allow appending to guest kernel cmdline in vmtest.sh Daniel Borkmann
2026-08-25 14:25 ` [PATCH bpf-next v2 10/11] selftests/bpf: Add tests for bpf keyring in signed loader Daniel Borkmann
2026-08-25 14:25 ` [PATCH bpf-next v2 11/11] Documentation/bpf: Document the bpf keyring and improve examples Daniel Borkmann
2026-08-28  1:38 ` [PATCH bpf-next v2 00/11] BPF keyring and signed loader ML-DSA support Jarkko Sakkinen

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=20260825143630.86BF41F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox