From 4514a62beb19b322a1b9bbab2f3568ff6de2b5fe Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 20 Jan 2025 23:01:16 +0800 Subject: [PATCH] cryptodev-linux: fix for linux 6.12 --- ...ev_verbosity-fix-build-for-linux-6.4.patch | 4 +- ...01-zero-copy-fix-build-for-linux-6.4.patch | 4 +- ...nux-version-ifdefs-from-v6.4-to-v6.5.patch | 8 +--- .../0004-fix-build-for-linux-6.7-rc1.patch | 4 +- ..._verbosity-sysctl-for-Linux-6.11-rc1.patch | 37 +++++++++++++++++++ 5 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 package/kernel/cryptodev-linux/patches/0010-Fix-cryptodev_verbosity-sysctl-for-Linux-6.11-rc1.patch diff --git a/package/kernel/cryptodev-linux/patches/0001-cryptodev_verbosity-fix-build-for-linux-6.4.patch b/package/kernel/cryptodev-linux/patches/0001-cryptodev_verbosity-fix-build-for-linux-6.4.patch index 390faec9c..2d958f904 100644 --- a/package/kernel/cryptodev-linux/patches/0001-cryptodev_verbosity-fix-build-for-linux-6.4.patch +++ b/package/kernel/cryptodev-linux/patches/0001-cryptodev_verbosity-fix-build-for-linux-6.4.patch @@ -13,11 +13,9 @@ Signed-off-by: Gaurav Jain ioctl.c | 6 ++++++ 1 file changed, 6 insertions(+) -diff --git a/ioctl.c b/ioctl.c -index 8f241b86..4262bbd5 100644 --- a/ioctl.c +++ b/ioctl.c -@@ -1246,7 +1246,9 @@ static struct ctl_table verbosity_ctl_root[] = { +@@ -1246,7 +1246,9 @@ static struct ctl_table verbosity_ctl_ro { .procname = "ioctl", .mode = 0555, diff --git a/package/kernel/cryptodev-linux/patches/0001-zero-copy-fix-build-for-linux-6.4.patch b/package/kernel/cryptodev-linux/patches/0001-zero-copy-fix-build-for-linux-6.4.patch index 0b8147d56..4d2dd13ae 100644 --- a/package/kernel/cryptodev-linux/patches/0001-zero-copy-fix-build-for-linux-6.4.patch +++ b/package/kernel/cryptodev-linux/patches/0001-zero-copy-fix-build-for-linux-6.4.patch @@ -12,11 +12,9 @@ Signed-off-by: Gaurav Jain zc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -diff --git a/zc.c b/zc.c -index fdf7da17..6637945a 100644 --- a/zc.c +++ b/zc.c -@@ -80,10 +80,14 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write, +@@ -80,10 +80,14 @@ int __get_userbuf(uint8_t __user *addr, ret = get_user_pages_remote(task, mm, (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, pg, NULL, NULL); diff --git a/package/kernel/cryptodev-linux/patches/0003-move-recent-linux-version-ifdefs-from-v6.4-to-v6.5.patch b/package/kernel/cryptodev-linux/patches/0003-move-recent-linux-version-ifdefs-from-v6.4-to-v6.5.patch index baf5b805c..576269c10 100644 --- a/package/kernel/cryptodev-linux/patches/0003-move-recent-linux-version-ifdefs-from-v6.4-to-v6.5.patch +++ b/package/kernel/cryptodev-linux/patches/0003-move-recent-linux-version-ifdefs-from-v6.4-to-v6.5.patch @@ -23,11 +23,9 @@ Signed-off-by: Joan Bruguera Micó zc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -diff --git a/ioctl.c b/ioctl.c -index 4262bbd..e3eefe1 100644 --- a/ioctl.c +++ b/ioctl.c -@@ -1246,7 +1246,7 @@ static struct ctl_table verbosity_ctl_root[] = { +@@ -1246,7 +1246,7 @@ static struct ctl_table verbosity_ctl_ro { .procname = "ioctl", .mode = 0555, @@ -45,11 +43,9 @@ index 4262bbd..e3eefe1 100644 verbosity_sysctl_header = register_sysctl_table(verbosity_ctl_root); #else verbosity_sysctl_header = register_sysctl(verbosity_ctl_root->procname, verbosity_ctl_dir); -diff --git a/zc.c b/zc.c -index 6637945..00e00c1 100644 --- a/zc.c +++ b/zc.c -@@ -80,7 +80,7 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write, +@@ -80,7 +80,7 @@ int __get_userbuf(uint8_t __user *addr, ret = get_user_pages_remote(task, mm, (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, pg, NULL, NULL); diff --git a/package/kernel/cryptodev-linux/patches/0004-fix-build-for-linux-6.7-rc1.patch b/package/kernel/cryptodev-linux/patches/0004-fix-build-for-linux-6.7-rc1.patch index 3ef9e28ce..4fded72fa 100644 --- a/package/kernel/cryptodev-linux/patches/0004-fix-build-for-linux-6.7-rc1.patch +++ b/package/kernel/cryptodev-linux/patches/0004-fix-build-for-linux-6.7-rc1.patch @@ -17,11 +17,9 @@ Signed-off-by: Joan Bruguera Micó 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, +@@ -381,7 +381,11 @@ int cryptodev_hash_init(struct hash_data } hdata->digestsize = crypto_ahash_digestsize(hdata->async.s); diff --git a/package/kernel/cryptodev-linux/patches/0010-Fix-cryptodev_verbosity-sysctl-for-Linux-6.11-rc1.patch b/package/kernel/cryptodev-linux/patches/0010-Fix-cryptodev_verbosity-sysctl-for-Linux-6.11-rc1.patch new file mode 100644 index 000000000..d04a4203e --- /dev/null +++ b/package/kernel/cryptodev-linux/patches/0010-Fix-cryptodev_verbosity-sysctl-for-Linux-6.11-rc1.patch @@ -0,0 +1,37 @@ +From d481e9718ef2edd4e003d3618e7673507e9503bb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= +Date: Fri, 19 Jul 2024 20:18:31 +0000 +Subject: [PATCH] Fix cryptodev_verbosity sysctl for Linux 6.11-rc1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There has been a long-running Linux kernel effort to get rid of the +sentinels of `struct ctl_table`. In Linux 6.11 it has been completed, +and registering a sysctl with a sentinel will fail with a dmesg error: + +> sysctl table check failed: ioctl/(null) procname is null +> sysctl table check failed: ioctl/(null) No proc_handler + +Exclude the sentinels since that version. + +See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f8a8b94d0698ccc56c44478169c91ca774540d9f + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9edbfe92a0a1355bae1e47c8f542ac0d39f19f8c + +Signed-off-by: Joan Bruguera Micó +--- + ioctl.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/ioctl.c ++++ b/ioctl.c +@@ -1239,7 +1239,9 @@ static struct ctl_table verbosity_ctl_dir[] = { + .mode = 0644, + .proc_handler = proc_dointvec, + }, ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)) + {}, ++#endif + }; + + static struct ctl_table verbosity_ctl_root[] = {