From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [PATCH] staging: kpc2000: Fix a stack information leak in kp2000_cdev_ioctl()
Date: Tue, 30 Apr 2019 10:35:05 +0000 [thread overview]
Message-ID: <20190430103505.GB7064@mwanda> (raw)
The kp2000_regs struct has a 4 byte hole between ->hw_rev and ->ssid so
this could leak stack information to the user. This patch just memsets
the whole struct to zero.
Fixes: 7dc7967fc39a ("staging: kpc2000: add initial set of Daktronics drivers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/staging/kpc2000/kpc2000/fileops.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/kpc2000/kpc2000/fileops.c b/drivers/staging/kpc2000/kpc2000/fileops.c
index 4bfba59570e6..a6beca8dbac5 100644
--- a/drivers/staging/kpc2000/kpc2000/fileops.c
+++ b/drivers/staging/kpc2000/kpc2000/fileops.c
@@ -91,6 +91,8 @@ long kp2000_cdev_ioctl(struct file *filp, unsigned int ioctl_num, unsigned long
case KP2000_IOCTL_GET_EVERYTHING: {
struct kp2000_regs temp;
int ret;
+
+ memset(&temp, 0, sizeof(temp));
temp.card_id = pcard->card_id;
temp.build_version = pcard->build_version;
temp.build_datestamp = pcard->build_datestamp;
--
2.18.0
reply other threads:[~2019-04-30 10:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20190430103505.GB7064@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@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