<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 21 April 2015 at 04:48, Thomas Gleixner <span dir="ltr"><<a href="mailto:tglx@linutronix.de" target="_blank">tglx@linutronix.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Mon, 20 Apr 2015, Baolin Wang wrote:<br>
>  /* Set clock_realtime */<br>
>  static int posix_clock_realtime_set(const clockid_t which_clock,<br>
> -                                 const struct timespec *tp)<br>
> +                                 const struct timespec64 *tp)<br>
>  {<br>
> -     return do_sys_settimeofday(tp, NULL);<br>
> +     struct timespec ts = timespec64_to_timespec(*tp);<br>
> +<br>
> +     return do_sys_settimeofday(&ts, NULL);<br>
<br>
</span>Sigh. No. We first provide a proper function for this, which takes a<br>
timespec64, i.e. do_sys_settimeofday64() instead of having this<br>
wrapper mess all over the place.<br></blockquote><div><br></div><span style="font-size:13px">Thanks for your comments,but if use </span>do_sys_settimeofday64() here that will <span style="font-size:13px"> introduce a security bug: do_sys_settimeofday contains a capability</span></div><div class="gmail_quote"><span style="font-size:13px">check that normally prevents non-root users from setting the time.</span><br style="font-size:13px"><br style="font-size:13px"><div><span style="font-size:13px">With your change, any user can set the system time.</span> </div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
>       /* SIGEV_NONE timers are not queued ! See common_timer_get */<br>
>       if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) {<br>
> diff --git a/kernel/time/timekeeping.h b/kernel/time/timekeeping.h<br>
> index 1d91416..144af14 100644<br>
> --- a/kernel/time/timekeeping.h<br>
> +++ b/kernel/time/timekeeping.h<br>
> @@ -15,7 +15,7 @@ extern u64 timekeeping_max_deferment(void);<br>
>  extern int timekeeping_inject_offset(struct timespec *ts);<br>
>  extern s32 timekeeping_get_tai_offset(void);<br>
>  extern void timekeeping_set_tai_offset(s32 tai_offset);<br>
> -extern void timekeeping_clocktai(struct timespec *ts);<br>
> +extern void timekeeping_clocktai(struct timespec64 *ts);<br>
<br>
</span># git grep timekeeping_clocktai() is your friend.<br>
<br>
Thanks,<br>
<br>
        tglx<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Baolin.wang<br></div>Best Regards<br></div></div>
</div></div>