lkml.org 
[lkml]   [2015]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] time: verify time values in adjtimex ADJ_SETOFFSET to avoid overflow
On Mon, 7 Dec 2015, John Stultz wrote:

> On Sun, Dec 6, 2015 at 2:11 PM, Richard Cochran
> <richardcochran@gmail.com> wrote:
> > The overflow is a latent problem, and the patch should:
> >
> > 1. return error in case (txc->time.tv_usec >= USEC_PER_SEC)
> > 2. remove the redundant test in timekeeping_inject_offset.
>
> So we probably want to keep the check in timekeeping_inject_offset()
> since there can be other users as well of that function.
>
> But its probably cleanest to add a check in ntp_validate_timex()
> instead of where this patch does it.

So instead of open coding the checks on both sites, can we please have
an inline function with proper comments why time.tv_sec can be
negative, something like adjtimex_timeval_is_valid() or such.

Thanks,

tglx






\
 
 \ /
  Last update: 2015-12-07 21:21    [W:0.074 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site