All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: davem@davemloft.net
Cc: linux-ide@vger.kernel.org
Subject: [PATCH] ide-tape: Don't leak kernel stack information
Date: Sun, 19 Jul 2009 21:15:19 +0200	[thread overview]
Message-ID: <200907192115.19958.mb@bu3sch.de> (raw)

Don't leak kernel stack information through uninitialized structure members.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: stable@kernel.org

---

This patch is only compile tested.

---
 drivers/ide/ide-tape.c |    1 +
 1 file changed, 1 insertion(+)

--- linux-2.6.orig/drivers/ide/ide-tape.c
+++ linux-2.6/drivers/ide/ide-tape.c
@@ -1057,20 +1057,21 @@ static int idetape_blkdev_ioctl(ide_driv
 
 	debug_log(DBG_PROCS, "Enter %s\n", __func__);
 
 	switch (cmd) {
 	case 0x0340:
 		if (copy_from_user(&config, argp, sizeof(config)))
 			return -EFAULT;
 		tape->best_dsc_rw_freq = config.dsc_rw_frequency;
 		break;
 	case 0x0350:
+		memset(&config, 0, sizeof(config));
 		config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq;
 		config.nr_stages = 1;
 		if (copy_to_user(argp, &config, sizeof(config)))
 			return -EFAULT;
 		break;
 	default:
 		return -EIO;
 	}
 	return 0;
 }

-- 
Greetings, Michael.

             reply	other threads:[~2009-07-19 19:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-19 19:15 Michael Buesch [this message]
2009-07-20  7:38 ` [PATCH] ide-tape: Don't leak kernel stack information Borislav Petkov
2009-07-20 10:57   ` Michael Buesch
2009-07-21 10:06   ` Bartlomiej Zolnierkiewicz
2009-07-20 10:45     ` Borislav Petkov
2009-07-21 12:10       ` Bartlomiej Zolnierkiewicz
2009-07-20 12:49         ` Borislav Petkov
2009-07-22  3:36           ` David Miller

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=200907192115.19958.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=davem@davemloft.net \
    --cc=linux-ide@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.