[PATCH 02/18] drivers/autotune: do not read user data we should not expect
Philippe Gerum
rpm at xenomai.org
Mon Feb 4 11:56:31 CET 2019
We receive the sampling period from the setup struct attached to the
AUTOTUNE_RTIOC_{IRQ,KERN,USER} requests, drop the last copy from user
from autotune_ioctl_nrt() which is spurious.
Signed-off-by: Philippe Gerum <rpm at xenomai.org>
---
kernel/drivers/autotune/autotune.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/kernel/drivers/autotune/autotune.c b/kernel/drivers/autotune/autotune.c
index 46a34bf36..2629bf9d4 100644
--- a/kernel/drivers/autotune/autotune.c
+++ b/kernel/drivers/autotune/autotune.c
@@ -644,7 +644,7 @@ static int autotune_ioctl_nrt(struct rtdm_fd *fd, unsigned int request, void *ar
struct autotune_context *context;
struct autotune_setup setup;
struct gravity_tuner *tuner;
- int period, ret;
+ int ret;
if (request == AUTOTUNE_RTIOC_RESET) {
xnclock_reset_gravity(&nkclock);
@@ -678,10 +678,6 @@ static int autotune_ioctl_nrt(struct rtdm_fd *fd, unsigned int request, void *ar
return -EINVAL;
}
- ret = rtdm_safe_copy_from_user(fd, &period, arg, sizeof(period));
- if (ret)
- return ret;
-
ret = tuner->init_tuner(tuner);
if (ret)
return ret;
--
2.17.2
More information about the Xenomai
mailing list