diff mbox series

[1/1] package/cryptodev-linux: fix build with kernel >= 6.7

Message ID 20240525061244.8014-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/cryptodev-linux: fix build with kernel >= 6.7 | expand

Commit Message

Fabrice Fontaine May 25, 2024, 6:12 a.m. UTC
Fix the following build failure with kernel >= 6.7:

/home/buildroot/autobuild/instance-0/output-1/build/cryptodev-linux-1.13/./cryptlib.c: In function ‘cryptodev_hash_init’:
/home/buildroot/autobuild/instance-0/output-1/build/cryptodev-linux-1.13/./cryptlib.c:384:28: error: implicit declaration of function ‘crypto_ahash_alignmask’; did you mean ‘crypto_aead_alignmask’? [-Werror=implicit-function-declaration]
  384 |         hdata->alignmask = crypto_ahash_alignmask(hdata->async.s);
      |                            ^~~~~~~~~~~~~~~~~~~~~~
      |                            crypto_aead_alignmask

Fixes:
 - http://autobuild.buildroot.org/results/466360c7baec2edf42dc6f0ad9a8d757dd471c88

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 .../0003-Fix-build-for-Linux-6-7-rc1.patch    | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 package/cryptodev-linux/0003-Fix-build-for-Linux-6-7-rc1.patch

Comments

Peter Korsgaard May 25, 2024, 4:35 p.m. UTC | #1
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure with kernel >= 6.7:
 > /home/buildroot/autobuild/instance-0/output-1/build/cryptodev-linux-1.13/./cryptlib.c: In function ‘cryptodev_hash_init’:
 > /home/buildroot/autobuild/instance-0/output-1/build/cryptodev-linux-1.13/./cryptlib.c:384:28:
 > error: implicit declaration of function ‘crypto_ahash_alignmask’; did
 > you mean ‘crypto_aead_alignmask’?
 > [-Werror=implicit-function-declaration]
 >   384 |         hdata->alignmask = crypto_ahash_alignmask(hdata->async.s);
 >       |                            ^~~~~~~~~~~~~~~~~~~~~~
 >       |                            crypto_aead_alignmask

 > Fixes:
 >  - http://autobuild.buildroot.org/results/466360c7baec2edf42dc6f0ad9a8d757dd471c88

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed, thanks.
Peter Korsgaard June 8, 2024, 2:01 p.m. UTC | #2
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure with kernel >= 6.7:
 > /home/buildroot/autobuild/instance-0/output-1/build/cryptodev-linux-1.13/./cryptlib.c: In function ‘cryptodev_hash_init’:
 > /home/buildroot/autobuild/instance-0/output-1/build/cryptodev-linux-1.13/./cryptlib.c:384:28:
 > error: implicit declaration of function ‘crypto_ahash_alignmask’; did
 > you mean ‘crypto_aead_alignmask’?
 > [-Werror=implicit-function-declaration]
 >   384 |         hdata->alignmask = crypto_ahash_alignmask(hdata->async.s);
 >       |                            ^~~~~~~~~~~~~~~~~~~~~~
 >       |                            crypto_aead_alignmask

 > Fixes:
 >  - http://autobuild.buildroot.org/results/466360c7baec2edf42dc6f0ad9a8d757dd471c88

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2024.02.x, thanks.
diff mbox series

Patch

diff --git a/package/cryptodev-linux/0003-Fix-build-for-Linux-6-7-rc1.patch b/package/cryptodev-linux/0003-Fix-build-for-Linux-6-7-rc1.patch
new file mode 100644
index 0000000000..4fdccaf6e0
--- /dev/null
+++ b/package/cryptodev-linux/0003-Fix-build-for-Linux-6-7-rc1.patch
@@ -0,0 +1,38 @@ 
+From 5e7121e45ff283d30097da381fd7e97c4bb61364 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
+Date: Sun, 10 Dec 2023 13:57:55 +0000
+Subject: [PATCH] Fix build for Linux 6.7-rc1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since Linux 6.7-rc1, no ahash algorithms set a nonzero alignmask,
+and therefore `crypto_ahash_alignmask` has been removed.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0f8660c82b79af595b056f6b9f4f227edeb88574
+          https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c626910f3f1bbce6ad18bc613d895d2a089ed95e
+
+Signed-off-by: Joan Bruguera Micó <joanbrugueram@gmail.com>
+
+Upstream: https://github.com/cryptodev-linux/cryptodev-linux/commit/5e7121e45ff283d30097da381fd7e97c4bb61364
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ cryptlib.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/cryptlib.c b/cryptlib.c
+index 4d739e5..0e59d4c 100644
+--- a/cryptlib.c
++++ b/cryptlib.c
+@@ -381,7 +381,11 @@ int cryptodev_hash_init(struct hash_data *hdata, const char *alg_name,
+ 	}
+ 
+ 	hdata->digestsize = crypto_ahash_digestsize(hdata->async.s);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0))
+ 	hdata->alignmask = crypto_ahash_alignmask(hdata->async.s);
++#else
++	hdata->alignmask = 0;
++#endif
+ 
+ 	init_completion(&hdata->async.result.completion);
+