patch 'kni: fix ioctl signature' has been queued to stable release 19.11.12

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Fri Feb 25 18:15:24 CET 2022


Hi,

FYI, your patch has been queued to stable release 19.11.12

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/7eb7d8589b1caa3b9e92a6460d43668ced1ead72

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 7eb7d8589b1caa3b9e92a6460d43668ced1ead72 Mon Sep 17 00:00:00 2001
From: Markus Theil <markus.theil at secunet.com>
Date: Fri, 3 Dec 2021 08:19:07 +0100
Subject: [PATCH] kni: fix ioctl signature

[ upstream commit f1b2991c3c0f480fe8e9f6c5c640a1d913b76bed ]

Fix kni's ioctl signature to correctly match the kernel's
structs. This shaves off the (void*) casts and uses struct file*
instead of struct inode*. With the correct signature, control flow
integrity checkers are no longer confused at this point.

Signed-off-by: Markus Theil <markus.theil at secunet.com>
Tested-by: Michael Pfeiffer <michael.pfeiffer at tu-ilmenau.de>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
 kernel/linux/kni/kni_misc.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c
index f4944e1ddf..9b3d20ec69 100644
--- a/kernel/linux/kni/kni_misc.c
+++ b/kernel/linux/kni/kni_misc.c
@@ -478,10 +478,10 @@ kni_ioctl_release(struct net *net, uint32_t ioctl_num,
 	return ret;
 }
 
-static int
-kni_ioctl(struct inode *inode, uint32_t ioctl_num, unsigned long ioctl_param)
+static long
+kni_ioctl(struct file *file, unsigned int ioctl_num, unsigned long ioctl_param)
 {
-	int ret = -EINVAL;
+	long ret = -EINVAL;
 	struct net *net = current->nsproxy->net_ns;
 
 	pr_debug("IOCTL num=0x%0x param=0x%0lx\n", ioctl_num, ioctl_param);
@@ -507,8 +507,8 @@ kni_ioctl(struct inode *inode, uint32_t ioctl_num, unsigned long ioctl_param)
 	return ret;
 }
 
-static int
-kni_compat_ioctl(struct inode *inode, uint32_t ioctl_num,
+static long
+kni_compat_ioctl(struct file *file, unsigned int ioctl_num,
 		unsigned long ioctl_param)
 {
 	/* 32 bits app on 64 bits OS to be supported later */
@@ -521,8 +521,8 @@ static const struct file_operations kni_fops = {
 	.owner = THIS_MODULE,
 	.open = kni_open,
 	.release = kni_release,
-	.unlocked_ioctl = (void *)kni_ioctl,
-	.compat_ioctl = (void *)kni_compat_ioctl,
+	.unlocked_ioctl = kni_ioctl,
+	.compat_ioctl = kni_compat_ioctl,
 };
 
 static struct miscdevice kni_misc = {
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.469448904 +0100
+++ 0031-kni-fix-ioctl-signature.patch	2022-02-25 16:58:44.244990416 +0100
@@ -1 +1 @@
-From f1b2991c3c0f480fe8e9f6c5c640a1d913b76bed Mon Sep 17 00:00:00 2001
+From 7eb7d8589b1caa3b9e92a6460d43668ced1ead72 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f1b2991c3c0f480fe8e9f6c5c640a1d913b76bed ]
+
@@ -19 +21 @@
-index e8a8203c90..ec70190042 100644
+index f4944e1ddf..9b3d20ec69 100644
@@ -22 +24 @@
-@@ -480,10 +480,10 @@ kni_ioctl_release(struct net *net, uint32_t ioctl_num,
+@@ -478,10 +478,10 @@ kni_ioctl_release(struct net *net, uint32_t ioctl_num,
@@ -36 +38 @@
-@@ -509,8 +509,8 @@ kni_ioctl(struct inode *inode, uint32_t ioctl_num, unsigned long ioctl_param)
+@@ -507,8 +507,8 @@ kni_ioctl(struct inode *inode, uint32_t ioctl_num, unsigned long ioctl_param)
@@ -47 +49 @@
-@@ -523,8 +523,8 @@ static const struct file_operations kni_fops = {
+@@ -521,8 +521,8 @@ static const struct file_operations kni_fops = {


More information about the stable mailing list