mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] char: genrtc: fix infoleak to userspace
@ 2011-04-09 12:41 Vasiliy Kulikov
  0 siblings, 0 replies; only message in thread
From: Vasiliy Kulikov @ 2011-04-09 12:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, Frederic Weisbecker

struct pll is copied to userspace.  It is filled in "multiplexing" function
get_rtc_pll().  At least one implementator, q40_get_rtc_pll(), doesn't
fill .pll_ctrl field.  It's hard to understand whether either the caller
or the callee must zero the unused struct fields, however, on another
ioctl commands the caller already zeroes the structure.  So, let's the
caller use memset().

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
---
 drivers/char/genrtc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c
index f773a9d..65cd683 100644
--- a/drivers/char/genrtc.c
+++ b/drivers/char/genrtc.c
@@ -273,6 +273,7 @@ static int gen_rtc_ioctl(struct file *file,
 	switch (cmd) {
 
 	case RTC_PLL_GET:
+	    memset(&pll, 0, sizeof(pll));
 	    if (get_rtc_pll(&pll))
 	 	    return -EINVAL;
 	    else
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-09 12:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-09 12:41 [PATCH] char: genrtc: fix infoleak to userspace Vasiliy Kulikov

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®