summaryrefslogtreecommitdiff
path: root/kernel/time/ntp.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-01-26 11:02:59 +0100
committerThomas Gleixner <tglx@linutronix.de>2015-01-26 11:02:59 +0100
commit64c96a57b73397415eafa4ac2020ea7d99d7168c (patch)
treee71719d174d22aab6362858d383c292149ec8ae9 /kernel/time/ntp.c
parente2e64a932556cdfae455497dbe94a8db151fc9fa (diff)
parent26bc420b59a38e4e6685a73345a0def461136dce (diff)
Merge branch 'linus' into irq/core
Reason: Pull in upstream fixes on which new patches depend on.
Diffstat (limited to 'kernel/time/ntp.c')
-rw-r--r--kernel/time/ntp.c7
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;
}