From f3a48e6cd4b63ab6c233801c427d64f7a1c310c8 Mon Sep 17 00:00:00 2001 From: Massimiliano Pellizzer Date: Tue, 4 Mar 2025 09:34:25 +0100 Subject: [PATCH 1/2] Support Linux 6.12: move asm/unaligned.h to linux/unaligned.h In Linux 6.12 the header asm/unaligned.h has been moved to linux/unaligned.h. See commit 5f60d5f6bbc12e move asm/unaligned.h to linux/unaligned.h This causes the following compile time error: magma_generic.c:14:10: fatal error: asm/unaligned.h: No such file or directory 14 | #include | ^~~~~~~~~~~~~~~~~ gosthash94_generic.c:34:10: fatal error: asm/unaligned.h: No such file or directory 34 | #include | ^~~~~~~~~~~~~~~~~ compilation terminated. kuznyechik_generic.c:15:10: fatal error: asm/unaligned.h: No such file or directory 15 | #include | ^~~~~~~~~~~~~~~~~ gost28147_basic.c:42:10: fatal error: asm/unaligned.h: No such file or directory 42 | #include | ^~~~~~~~~~~~~~~~~ Adjust the code for kernels >= 6.12. Signed-off-by: Massimiliano Pellizzer --- gost28147_basic.c | 4 ++++ gost28147_modes.c | 4 ++++ gosthash94_generic.c | 5 +++++ kuznyechik_generic.c | 4 ++++ magma_generic.c | 5 +++++ 5 files changed, 22 insertions(+) diff --git a/gost28147_basic.c b/gost28147_basic.c index f524519..4f08208 100644 --- a/gost28147_basic.c +++ b/gost28147_basic.c @@ -39,7 +39,11 @@ #include #include #include +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) #include +#else +#include +#endif #include "gost28147_int.h" #include "gost28147_param.h" diff --git a/gost28147_modes.c b/gost28147_modes.c index 993404b..c605fea 100644 --- a/gost28147_modes.c +++ b/gost28147_modes.c @@ -38,7 +38,11 @@ #include #include #include +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) #include +#else +#include +#endif #include "gost28147_int.h" struct crypto_gost28147_mode_ctx { diff --git a/gosthash94_generic.c b/gosthash94_generic.c index 876bd39..66630ab 100644 --- a/gosthash94_generic.c +++ b/gosthash94_generic.c @@ -29,9 +29,14 @@ #include #include +#include #include +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) #include +#else +#include +#endif #include #include diff --git a/kuznyechik_generic.c b/kuznyechik_generic.c index 5f48419..759c4a9 100644 --- a/kuznyechik_generic.c +++ b/kuznyechik_generic.c @@ -12,7 +12,11 @@ #include #include #include +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) #include +#else +#include +#endif #include #include diff --git a/magma_generic.c b/magma_generic.c index 85f13ba..af1fc07 100644 --- a/magma_generic.c +++ b/magma_generic.c @@ -11,7 +11,12 @@ #include #include +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) #include +#else +#include +#endif #include #include #include From ae2ae99c0eadd70c23d03d41cad9d69e4296f5d9 Mon Sep 17 00:00:00 2001 From: Massimiliano Pellizzer Date: Tue, 4 Mar 2025 09:38:20 +0100 Subject: [PATCH 2/2] Support Linux 6.13: convert symbol namespace to string literal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Linux 6.13 symbol namespaces has been converted to string literals. See commit cdd30ebb1b9f36 module: Convert symbol namespace to string literal. This causes the following compile time error: In file included from /usr/src/linux-headers-6.14.0-5-generic/include/linux/module.h:22, from testmgr.c:27: testmgr.c:35:18: error: expected ‘,’ or ‘;’ before ‘CRYPTO_INTERNAL’ 35 | MODULE_IMPORT_NS(CRYPTO_INTERNAL); | ^~~~~~~~~~~~~~~ /usr/src/linux-headers-6.14.0-5-generic/include/linux/moduleparam.h:26:61: note: in definition of macro ‘__MODULE_INFO’ 26 | = __MODULE_INFO_PREFIX __stringify(tag) "=" info | ^~~~ /usr/src/linux-headers-6.14.0-5-generic/include/linux/module.h:299:33: note: in expansion of macro ‘MODULE_INFO’ 299 | #define MODULE_IMPORT_NS(ns) MODULE_INFO(import_ns, ns) | ^~~~~~~~~~~ testmgr.c:35:1: note: in expansion of macro ‘MODULE_IMPORT_NS’ 35 | MODULE_IMPORT_NS(CRYPTO_INTERNAL); | ^~~~~~~~~~~~~~~~ Adjust the code for kernels >= 6.13. Signed-off-by: Massimiliano Pellizzer --- testmgr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testmgr.c b/testmgr.c index 0917162..57756fe 100644 --- a/testmgr.c +++ b/testmgr.c @@ -32,8 +32,12 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0) #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0) +MODULE_IMPORT_NS("CRYPTO_INTERNAL"); +#else MODULE_IMPORT_NS(CRYPTO_INTERNAL); -#endif +#endif // kernel >= 6.13 +#endif // kernel >= 5.12 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) #define CRYPTO_TFM_REQ_FORBID_WEAK_KEYS CRYPTO_TFM_REQ_WEAK_KEY