diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-01-28 15:42:56 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-01-28 15:42:56 +0100 |
commit | f10698ed6807dc41d021fb7baeb24f9bc4051837 (patch) | |
tree | fe9229efe38ad31788843a7535bfc3feb89f79a7 /kernel/time/ntp.c | |
parent | 86038c5ea81b519a8a1fcfcd5e4599aab0cdd119 (diff) | |
parent | e742f3dc0886a92403d578e8ac771e5e33d06d08 (diff) |
Merge branch 'perf/urgent' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/time/ntp.c')
-rw-r--r-- | kernel/time/ntp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 87a346fd6d61..28bf91c60a0b 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -633,6 +633,13 @@ int ntp_validate_timex(struct timex *txc) if ((txc->modes & ADJ_SETOFFSET) && (!capable(CAP_SYS_TIME))) return -EPERM; + if (txc->modes & ADJ_FREQUENCY) { + if (LONG_MIN / PPM_SCALE > txc->freq) + return -EINVAL; + if (LONG_MAX / PPM_SCALE < txc->freq) + return -EINVAL; + } + return 0; } |