From: Matteo Semenzato <[email protected]>

The comedi_cmd struct has an hole after chanlist_len that could contain 
uninitialized
memory, this struct is copied to userspace.

Signed-off-by: Matteo Semenato <[email protected]>
---
 drivers/staging/comedi/comedi_fops.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index 727640e..1cdf0a2 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1718,6 +1718,8 @@ static int do_cmdtest_ioctl(struct comedi_device *dev,
        unsigned int __user *user_chanlist;
        int ret;
 
+       memset(&cmd, 0, sizeof(cmd));
+
        /* get the user's cmd and do some simple validation */
        ret = __comedi_get_user_cmd(dev, arg, &cmd);
        if (ret)
-- 
2.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to