cryptodev-linux: fix for linux 6.12

This commit is contained in:
coolsnowwolf 2025-01-20 23:01:16 +08:00
parent 6488a08057
commit 4514a62beb
5 changed files with 42 additions and 15 deletions

View File

@ -13,11 +13,9 @@ Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
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,

View File

@ -12,11 +12,9 @@ Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
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);

View File

@ -23,11 +23,9 @@ Signed-off-by: Joan Bruguera Micó <joanbrugueram@gmail.com>
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);

View File

@ -17,11 +17,9 @@ Signed-off-by: Joan Bruguera Micó <joanbrugueram@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,
@@ -381,7 +381,11 @@ int cryptodev_hash_init(struct hash_data
}
hdata->digestsize = crypto_ahash_digestsize(hdata->async.s);

View File

@ -0,0 +1,37 @@
From d481e9718ef2edd4e003d3618e7673507e9503bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
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ó <joanbrugueram@gmail.com>
---
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[] = {