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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 18 13:38:40 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.5

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/20/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/1b61157ec9460a316b25d456624222c6da43eb75

Thanks.

Luca Boccassi

---
>From 1b61157ec9460a316b25d456624222c6da43eb75 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 aae977c187..c8da5805c0 100644
--- a/kernel/linux/kni/kni_misc.c
+++ b/kernel/linux/kni/kni_misc.c
@@ -485,10 +485,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);
@@ -514,8 +514,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 */
@@ -528,8 +528,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.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-18 12:37:40.703388238 +0000
+++ 0071-kni-fix-ioctl-signature.patch	2022-02-18 12:37:37.746793171 +0000
@@ -1 +1 @@
-From f1b2991c3c0f480fe8e9f6c5c640a1d913b76bed Mon Sep 17 00:00:00 2001
+From 1b61157ec9460a316b25d456624222c6da43eb75 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f1b2991c3c0f480fe8e9f6c5c640a1d913b76bed ]
+
@@ -19 +21 @@
-index e8a8203c90..ec70190042 100644
+index aae977c187..c8da5805c0 100644
@@ -22 +24 @@
-@@ -480,10 +480,10 @@ kni_ioctl_release(struct net *net, uint32_t ioctl_num,
+@@ -485,10 +485,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)
+@@ -514,8 +514,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 = {
+@@ -528,8 +528,8 @@ static const struct file_operations kni_fops = {


More information about the stable mailing list