lkml.org 
[lkml]   [2011]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] rtc: Initialized rtc_time->tm_isdst
From
On Fri, Aug 12, 2011 at 2:04 PM, Mike Waychison <mikew@google.com> wrote:
> 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.

Thanks for catching this! I've queued this in my tree.

thanks
-john
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-08-13 01:31    [W:0.030 / U:2.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site