mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matteo Semenzato <mattew8898@gmail.com>
To: gregkh@linuxfoundation.org, abbotti@mev.co.uk,
	hsweeten@visionengravers.com
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Matteo Semenzato <mattew8898@gmail.com>
Subject: [PATCH] Staging: comedi: fix information leak
Date: Mon,  9 Mar 2015 21:08:17 +0100	[thread overview]
Message-ID: <1425931697-10301-1-git-send-email-mattew8898@gmail.com> (raw)

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


             reply	other threads:[~2015-03-09 20:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 20:08 Matteo Semenzato [this message]
2015-03-09 23:34 ` Ian Abbott
2015-03-10  6:44 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425931697-10301-1-git-send-email-mattew8898@gmail.com \
    --to=mattew8898@gmail.com \
    --cc=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®