summaryrefslogtreecommitdiffstats
path: root/kernel/time/ntp.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-01-22 12:26:41 +0100
committerThomas Gleixner <tglx@linutronix.de>2015-01-22 12:28:02 +0100
commit5fbaba8603d5bbc9e40bcb970bae64cb7e093755 (patch)
treebcffaa86c7be757ab4c34283d9b6ec8643101dd9 /kernel/time/ntp.c
parentf2a5473861cf69c03d0f0ee5d0ea1b853b9e582e (diff)
parent5e5aeb4367b450a28f447f6d5ab57d8f2ab16a5f (diff)
downloadop-kernel-dev-5fbaba8603d5bbc9e40bcb970bae64cb7e093755.zip
op-kernel-dev-5fbaba8603d5bbc9e40bcb970bae64cb7e093755.tar.gz
Merge branch 'fortglx/3.19-stable/time' of https://git.linaro.org/people/john.stultz/linux into timers/urgent
Pull urgent fixes from John Stultz: Two urgent fixes for user triggerable time related overflow issues
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 87a346f..28bf91c 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;
}
OpenPOWER on IntegriCloud