Mike Waychison a7402deb32 rtc: Initialized rtc_time->tm_isdst
Even though the Linux kernel does not use the tm_isdst field, it is
exposed as part of the ABI.  This field can accidentally be left
initialized, which is why we currently memset buffers returned to
userland in rtc_read_time.

There is a case however where the field can return garbage from the
stack though when using the RTC_ALM_READ ioctl on the rtc device.  This
ioctl invokes rtc_read_alarm, which is careful to memset the rtc_wkalrm
buffer that is copied to userland, but it then uses a struct copy to
assign to alarm->time given the return value from rtc_ktime_to_tm().

rtc_ktime_to_tm() is implemented by calling rtc_time_to_tm using a
derivative seconds counds from ktime, but rtc_time_to_tm does not assign
a value to ->tm_isdst.  This results in garbage from rtc_ktime_to_tm()'s
frame ending up being copied out to userland as part of the returned
rtc_wkalrm.

Fix this by initializing rtc_time->tm_isdst to 0 in rtc_time_to_tm.

Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-08-26 17:26:35 -07:00
..
2011-08-10 15:55:12 -07:00
2011-03-31 11:26:23 -03:00
2011-06-01 19:29:39 -07:00
2011-03-22 17:44:16 -07:00
2011-05-26 17:12:33 -07:00
2011-08-26 17:26:35 -07:00
2011-03-31 11:26:23 -03:00
2009-09-23 07:39:43 -07:00
2011-05-26 17:12:33 -07:00
2011-07-25 21:00:19 -07:00
2011-05-26 17:12:33 -07:00
2011-03-31 11:26:23 -03:00