Followup-For: Bug #1089497
Control: tag -1 patch pending

Hi,

I've just uploaded a NMU to DELAYED/10 to fix this and a few more
issues to make the package ready for trixie and Linux up to 6.13.

Patch series is attached.


Andreas
>From 432e3c5c98f2e1ab5a2d2b1747718f82b9728f05 Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <a...@debian.org>
Date: Mon, 24 Feb 2025 22:11:40 +0100
Subject: [PATCH 1/6] dkms.conf: Declare BUILD_EXCLUSIVE_KERNEL_MIN="4.3"

The skcipher interface was introduced in Linux v4.3.
---
 debian/gost-crypto-dkms.dkms | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/debian/gost-crypto-dkms.dkms b/debian/gost-crypto-dkms.dkms
index 460a18e..4b4215f 100644
--- a/debian/gost-crypto-dkms.dkms
+++ b/debian/gost-crypto-dkms.dkms
@@ -1,5 +1,9 @@
 PACKAGE_NAME="gost-crypto"
 PACKAGE_VERSION="#MODULE_VERSION#"
+
+# The skcipher interface was introduced in Linux v4.3
+BUILD_EXCLUSIVE_KERNEL_MIN="4.3"
+
 MAKE[0]="make -C ${kernel_source_dir} 
M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build"
 CLEAN="make -C ${kernel_source_dir} 
M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
 BUILT_MODULE_NAME[0]="gost28147_generic"
-- 
2.39.5

>From d90dbe3e41d81982628581d9b849950d290ee2ec Mon Sep 17 00:00:00 2001
From: Francesco C <fc.linuxu...@gmail.com>
Date: Mon, 16 Dec 2024 16:52:50 +0000
Subject: [PATCH 2/6] Fix module build for Linux 6.12

Closes: #1089497
---
 debian/patches/Linux-6.12.patch | 87 +++++++++++++++++++++++++++++++++
 debian/patches/series           |  1 +
 2 files changed, 88 insertions(+)
 create mode 100644 debian/patches/Linux-6.12.patch
 create mode 100644 debian/patches/series

diff --git a/debian/patches/Linux-6.12.patch b/debian/patches/Linux-6.12.patch
new file mode 100644
index 0000000..b88b314
--- /dev/null
+++ b/debian/patches/Linux-6.12.patch
@@ -0,0 +1,87 @@
+Author: Francesco C <fc.linuxu...@gmail.com>
+Description: fix module build for Linux 6.12: asm/unaligned.h moved to 
linux/unaligned.h
+
+--- gost-crypto-0.3.5/gost28147_basic.c    2023-06-24 00:31:16.000000000 +0200
++++ gost-crypto-0.3.6/gost28147_basic.c    2024-12-14 00:31:16.000000000 +0200
+@@ -39,7 +39,13 @@
+ #include <linux/crypto.h>
+ #include <linux/version.h>
+ #include <asm/byteorder.h>
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
+ #include <asm/unaligned.h>
++#else
++#include <linux/unaligned.h>
++#endif
++
+ #include "gost28147_int.h"
+ #include "gost28147_param.h"
+ 
+--- gost-crypto-0.3.5/gost28147_modes.c    2023-06-24 00:31:16.000000000 +0200
++++ gost-crypto-0.3.6/gost28147_modes.c    2024-12-14 00:31:16.000000000 +0200
+@@ -38,7 +38,13 @@
+ #include <linux/crypto.h>
+ #include <linux/version.h>
+ #include <asm/byteorder.h>
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
+ #include <asm/unaligned.h>
++#else
++#include <linux/unaligned.h>
++#endif
++
+ #include "gost28147_int.h"
+ 
+ struct crypto_gost28147_mode_ctx {
+
+--- gost-crypto-0.3.5/gosthash94_generic.c    2023-06-24 00:31:16.000000000 
+0200
++++ gost-crypto-0.3.6/gosthash94_generic.c    2024-12-14 00:31:16.000000000 
+0200
+@@ -29,9 +29,15 @@
+ 
+ #include <linux/crypto.h>
+ #include <linux/module.h>
++#include <linux/version.h>
+ 
+ #include <asm/byteorder.h>
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
+ #include <asm/unaligned.h>
++#else
++#include <linux/unaligned.h>
++#endif
+ 
+ #include <crypto/internal/hash.h>
+ #include <crypto/gost28147.h>
+
+--- gost-crypto-0.3.5/kuznyechik_generic.c    2023-06-24 00:31:16.000000000 
+0200
++++ gost-crypto-0.3.6/kuznyechik_generic.c    2024-12-14 00:31:16.000000000 
+0200
+@@ -12,7 +12,12 @@
+ #include <linux/crypto.h>
+ #include <linux/module.h>
+ #include <linux/version.h>
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
+ #include <asm/unaligned.h>
++#else
++#include <linux/unaligned.h>
++#endif
+ 
+ #include <crypto/algapi.h>
+ #include <crypto/kuznyechik.h>
+--- a/magma_generic.c
++++ b/magma_generic.c
+@@ -11,7 +11,14 @@
+ 
+ #include <linux/crypto.h>
+ #include <linux/module.h>
++#include <linux/version.h>
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
+ #include <asm/unaligned.h>
++#else
++#include <linux/unaligned.h>
++#endif
++
+ #include <crypto/algapi.h>
+ #include <crypto/magma.h>
+ #include <crypto/gost28147.h>
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..7a36bac
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+Linux-6.12.patch
-- 
2.39.5

From 7df28b1dd90f80041e152ce12a8204cd6ffd36d6 Mon Sep 17 00:00:00 2001
From: Massimiliano Pellizzer <massimiliano.pelliz...@canonical.com>
Date: Tue, 4 Mar 2025 13:30:06 +0100
Subject: [PATCH 3/6] Fix module build for Linux 6.13

---
 debian/patches/Linux-6.13.patch | 56 +++++++++++++++++++++++++++++++++
 debian/patches/series           |  1 +
 2 files changed, 57 insertions(+)
 create mode 100644 debian/patches/Linux-6.13.patch

diff --git a/debian/patches/Linux-6.13.patch b/debian/patches/Linux-6.13.patch
new file mode 100644
index 0000000..d6a5fad
--- /dev/null
+++ b/debian/patches/Linux-6.13.patch
@@ -0,0 +1,56 @@
+From ae2ae99c0eadd70c23d03d41cad9d69e4296f5d9 Mon Sep 17 00:00:00 2001
+From: Massimiliano Pellizzer <massimiliano.pelliz...@canonical.com>
+Date: Tue, 4 Mar 2025 09:38:20 +0100
+Subject: [PATCH] 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 <massimiliano.pelliz...@canonical.com>
+
+Origin: other, https://github.com/GostCrypt/linux-crypto/pull/9
+---
+ 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 <crypto/internal/cipher.h>
++#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
diff --git a/debian/patches/series b/debian/patches/series
index 7a36bac..e981d07 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 Linux-6.12.patch
+Linux-6.13.patch
-- 
2.39.5

>From d4a1138ab1532472007595de006a901e6b438311 Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <a...@debian.org>
Date: Tue, 4 Mar 2025 13:31:14 +0100
Subject: [PATCH 4/6] d/control: Declare Rules-Requires-Root: no

---
 debian/control | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/control b/debian/control
index 074e27c..dcf2af7 100644
--- a/debian/control
+++ b/debian/control
@@ -3,6 +3,7 @@ Section: kernel
 Priority: optional
 Maintainer: Dmitry Baryshkov <dbarysh...@gmail.com>
 Build-Depends: debhelper-compat (= 13), dh-sequence-dkms
+Rules-Requires-Root: no
 Testsuite: autopkgtest-pkg-dkms
 Standards-Version: 4.6.2
 Homepage: https://github.com/GostCrypt/linux-crypto
-- 
2.39.5

>From 5f43de381111ac1450b1ac5f92601ec12a4806ee Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <a...@debian.org>
Date: Tue, 4 Mar 2025 13:42:13 +0100
Subject: [PATCH 5/6] d/rules: Simplify

---
 debian/gost-crypto.install |  0
 debian/rules               | 16 +++-------------
 2 files changed, 3 insertions(+), 13 deletions(-)
 delete mode 100644 debian/gost-crypto.install

diff --git a/debian/gost-crypto.install b/debian/gost-crypto.install
deleted file mode 100644
index e69de29..0000000
diff --git a/debian/rules b/debian/rules
index 32a96a0..493c93b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,24 +3,14 @@
 # output every command that modifies files on the build system.
 #export DH_VERBOSE = 1
 
-include /usr/share/dpkg/default.mk
+include /usr/share/dpkg/pkg-info.mk
 
 SRCDIR = debian/tmp/usr/src/$(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM)
 
 %:
-       dh $@
-
-override_dh_auto_configure:
-
-override_dh_auto_build:
-
-override_dh_auto_clean:
+       dh $@ --buildsystem=none
 
 override_dh_auto_install:
-       install -d $(SRCDIR)
-       install -m 0644 *.[ch] Makefile $(SRCDIR)
        install -d $(SRCDIR)/crypto
+       install -m 0644 *.[ch] Makefile $(SRCDIR)
        install -m 0644 crypto/*.[ch] $(SRCDIR)/crypto
-
-override_dh_dkms:
-       dh_dkms -V
-- 
2.39.5

>From 47fdbe7fbcf48b085485680fbe91b70ef14364e6 Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <a...@debian.org>
Date: Tue, 4 Mar 2025 22:18:02 +0100
Subject: [PATCH 6/6] release gost-crypto (0.3.5-1.1) to unstable

---
 debian/changelog | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 11861d1..2191738 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,19 @@
+gost-crypto (0.3.5-1.1) unstable; urgency=medium
+
+  [ Andreas Beckmann ]
+  * Non-maintainer upload.
+  * dkms.conf: Declare BUILD_EXCLUSIVE_KERNEL_MIN="4.3".
+  * d/control: Declare Rules-Requires-Root: no.
+  * d/rules: Simplify.
+
+  [ Francesco C ]
+  * Fix module build for Linux 6.12.  (Closes: #1089497)
+
+  [ Massimiliano Pellizzer ]
+  * Fix module build for Linux 6.13.
+
+ -- Andreas Beckmann <a...@debian.org>  Tue, 04 Mar 2025 22:17:48 +0100
+
 gost-crypto (0.3.5-1) unstable; urgency=medium
 
   * New upstream version 0.3.5 (Closes: #1037998)
-- 
2.39.5

Reply via email to