linux-next: manual merge of the keys-next tree with the modules tree

Mark Brown posted 1 patch 4 days, 16 hours ago
linux-next: manual merge of the keys-next tree with the modules tree
Posted by Mark Brown 4 days, 16 hours ago
Hi all,

Today's linux-next merge of the keys-next tree got a conflict in:

  scripts/sign-file.c

between commit:

  d7afd65b4acc7 ("sign-file: Use only the OpenSSL CMS API for signing")

from the modules tree and commit:

  0ad9a71933e73 ("modsign: Enable ML-DSA module signing")

from the keys-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc scripts/sign-file.c
index 16f2bf2e1e3ce,78276b15ab23c..0000000000000
--- a/scripts/sign-file.c
+++ b/scripts/sign-file.c
@@@ -271,20 -314,49 +271,40 @@@ int main(int argc, char **argv
  		digest_algo = EVP_get_digestbyname(hash_algo);
  		ERR(!digest_algo, "EVP_get_digestbyname");
  
 -#ifndef USE_PKCS7
 -
+ 		unsigned int flags =
+ 			CMS_NOCERTS |
+ 			CMS_PARTIAL |
+ 			CMS_BINARY |
+ 			CMS_DETACHED |
+ 			CMS_STREAM  |
+ 			CMS_NOSMIMECAP |
+ #ifdef CMS_NO_SIGNING_TIME
+ 			CMS_NO_SIGNING_TIME |
+ #endif
+ 			use_keyid;
+ 
+ #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 in openssl-3.5
+ 			  * and before.
+ 			  */
+ 			use_signed_attrs = 0;
+ 		}
+ #endif
+ 
+ 		flags |= use_signed_attrs;
+ 
  		/* Load the signature message from the digest buffer. */
- 		cms = CMS_sign(NULL, NULL, NULL, NULL,
- 			       CMS_NOCERTS | CMS_PARTIAL | CMS_BINARY |
- 			       CMS_DETACHED | CMS_STREAM);
+ 		cms = CMS_sign(NULL, NULL, NULL, NULL, flags);
  		ERR(!cms, "CMS_sign");
  
- 		ERR(!CMS_add1_signer(cms, x509, private_key, digest_algo,
- 				     CMS_NOCERTS | CMS_BINARY |
- 				     CMS_NOSMIMECAP | CMS_NOATTR |
- 				     use_keyid),
+ 		ERR(!CMS_add1_signer(cms, x509, private_key, digest_algo, flags),
  		    "CMS_add1_signer");
- 		ERR(CMS_final(cms, bm, NULL, CMS_NOCERTS | CMS_BINARY) != 1,
+ 		ERR(CMS_final(cms, bm, NULL, flags) != 1,
  		    "CMS_final");
  
 -#else
 -		pkcs7 = PKCS7_sign(x509, private_key, NULL, bm,
 -				   PKCS7_NOCERTS | PKCS7_BINARY |
 -				   PKCS7_DETACHED | use_signed_attrs);
 -		ERR(!pkcs7, "PKCS7_sign");
 -#endif
 -
  		if (save_sig) {
  			char *sig_file_name;
  			BIO *b;
Re: linux-next: manual merge of the keys-next tree with the modules tree
Posted by Sami Tolvanen 4 days, 16 hours ago
Hi Mark,

On Tue, Feb 3, 2026 at 11:18 AM Mark Brown <broonie@kernel.org> wrote:
>
> Hi all,
>
> Today's linux-next merge of the keys-next tree got a conflict in:
>
>   scripts/sign-file.c
>
> between commit:
>
>   d7afd65b4acc7 ("sign-file: Use only the OpenSSL CMS API for signing")
>
> from the modules tree and commit:
>
>   0ad9a71933e73 ("modsign: Enable ML-DSA module signing")
>
> from the keys-next tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

I believe this still needs the previous fix-up:

https://lore.kernel.org/lkml/CABCJKuckAwav8bg20mz+SwgGb==pX09G1dhGV_3_URyMCGGTQw@mail.gmail.com/

Sami
Re: linux-next: manual merge of the keys-next tree with the modules tree
Posted by Mark Brown 4 days, 16 hours ago
On Tue, Feb 03, 2026 at 11:26:53AM -0800, Sami Tolvanen wrote:

> I believe this still needs the previous fix-up:

> https://lore.kernel.org/lkml/CABCJKuckAwav8bg20mz+SwgGb==pX09G1dhGV_3_URyMCGGTQw@mail.gmail.com/

Due to the way the scripting works that should have been carried forward
too.