[openwrt/openwrt] cryptodev-linux: add backport to build for 6.18

LEDE Commits lede-commits at lists.infradead.org
Tue Dec 23 09:07:08 PST 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/045007c24ccf6026441f3b6dc9902055174a3a2e

commit 045007c24ccf6026441f3b6dc9902055174a3a2e
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Tue Dec 16 16:42:12 2025 -0500

    cryptodev-linux: add backport to build for 6.18
    
    Add https://github.com/cryptodev-linux/cryptodev-linux/commit/08644db02d43478f802755903212f5ee506af73b
    to allow builds against the 6.18 series of kernels.
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21190
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/cryptodev-linux/Makefile            |  2 +-
 .../patches/002-Fix-build-for-Linux-6.18-rc1.patch | 49 ++++++++++++++++++++++
 2 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/package/kernel/cryptodev-linux/Makefile b/package/kernel/cryptodev-linux/Makefile
index 303c136a35..fb79d4c89b 100644
--- a/package/kernel/cryptodev-linux/Makefile
+++ b/package/kernel/cryptodev-linux/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=cryptodev-linux
 PKG_VERSION:=1.14
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=https://codeload.github.com/$(PKG_NAME)/$(PKG_NAME)/tar.gz/$(PKG_NAME)-$(PKG_VERSION)?
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/package/kernel/cryptodev-linux/patches/002-Fix-build-for-Linux-6.18-rc1.patch b/package/kernel/cryptodev-linux/patches/002-Fix-build-for-Linux-6.18-rc1.patch
new file mode 100644
index 0000000000..4cdb0e30f6
--- /dev/null
+++ b/package/kernel/cryptodev-linux/patches/002-Fix-build-for-Linux-6.18-rc1.patch
@@ -0,0 +1,49 @@
+From 08644db02d43478f802755903212f5ee506af73b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram at gmail.com>
+Date: Sat, 6 Sep 2025 20:36:38 +0000
+Subject: [PATCH] Fix build for Linux 6.18-rc1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It's no longer required to use nth_page() when iterating pages within a
+single scatterlist entry.
+
+Note I believe this code path in `sg_advance` is currently unreachable:
+It is only called from `get_userbuf_srtp`, passing in a scatterlist
+copied from one created by `__get_userbuf`, which only generates
+entries such that `sg->offset + sg->length <= PAGE_SIZE`.
+On the other hand, this code path in `sg_advance` requires that
+`sg->offset + sg->length > sg->offset + consumed >= PAGE_SIZE`.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f8f03eb5f0f91fddc9bb8563c7e82bd7d3ba1dd0
+          https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce00897b94bc5c62fab962625efcf1ab824d3688
+
+Signed-off-by: Joan Bruguera Micó <joanbrugueram at gmail.com>
+---
+ util.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/util.c
++++ b/util.c
+@@ -21,6 +21,7 @@
+ 
+ #include <crypto/scatterwalk.h>
+ #include <linux/scatterlist.h>
++#include <linux/version.h>
+ #include "util.h"
+ 
+ /* These were taken from Maxim Levitsky's patch to lkml.
+@@ -44,8 +45,12 @@ struct scatterlist *sg_advance(struct sc
+ 	sg->length -= consumed;
+ 
+ 	if (sg->offset >= PAGE_SIZE) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 18, 0))
++		struct page *page = sg_page(sg) + (sg->offset / PAGE_SIZE);
++#else
+ 		struct page *page =
+ 			nth_page(sg_page(sg), sg->offset / PAGE_SIZE);
++#endif
+ 		sg_set_page(sg, page, sg->length, sg->offset % PAGE_SIZE);
+ 	}
+ 




More information about the lede-commits mailing list