From: Cong Wang <amwang@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jens Axboe <axboe@kernel.dk>, Cong Wang <amwang@redhat.com>
Subject: [Patch] block: do not leak info to user-space
Date: Fri, 10 May 2013 17:06:28 +0800 [thread overview]
Message-ID: <1368176789-1973-1-git-send-email-amwang@redhat.com> (raw)
From: Cong Wang <amwang@redhat.com>
There is a hole in struct hd_geometry, so we have to
zero the struct on stack before copying it to user-space.
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
index 7c668c8..7e5d474 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -59,6 +59,7 @@ static int compat_hdio_getgeo(struct gendisk *disk, struct block_device *bdev,
if (!disk->fops->getgeo)
return -ENOTTY;
+ memset(&geo, 0, sizeof(geo));
/*
* We need to set the startsect first, the driver may
* want to override it.
reply other threads:[~2013-05-10 9:06 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=1368176789-1973-1-git-send-email-amwang@redhat.com \
--to=amwang@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--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