linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide-tape: Don't leak kernel stack information
@ 2009-07-19 19:15 Michael Buesch
  2009-07-20  7:38 ` Borislav Petkov
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Buesch @ 2009-07-19 19:15 UTC (permalink / raw)
  To: davem; +Cc: linux-ide

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.

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

end of thread, other threads:[~2009-07-22  3:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 19:15 [PATCH] ide-tape: Don't leak kernel stack information Michael Buesch
2009-07-20  7:38 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).