public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: fix information leak
@ 2015-03-09 20:08 Matteo Semenzato
  2015-03-09 23:34 ` Ian Abbott
  2015-03-10  6:44 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Matteo Semenzato @ 2015-03-09 20:08 UTC (permalink / raw)
  To: gregkh, abbotti, hsweeten; +Cc: devel, linux-kernel, Matteo Semenzato

From: Matteo Semenzato <mattew8898@gmail.com>

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 <mattew8898@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-10  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-09 20:08 [PATCH] Staging: comedi: fix information leak Matteo Semenzato
2015-03-09 23:34 ` Ian Abbott
2015-03-10  6:44 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox