Skip to contentSkip to conversation

char: genrtc: fix infoleak to userspace

PATCH New Vasiliy Kulikov 1 participant 1 message Apr 9, 2011 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 char: genrtc: fix infoleak to userspace

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().

---
 drivers/char/genrtc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/char/genrtc.c +1 -0
index f773a9d..65cd683 100644
@@ -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
Signature · 1 line
1.7.0.4