git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
time: adjtimex: Validate the ADJ_FREQUENCY values
[pandora-kernel.git]
/
kernel
/
time
/
ntp.c
diff --git
a/kernel/time/ntp.c
b/kernel/time/ntp.c
index
87a346f
..
28bf91c
100644
(file)
--- 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;
}