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
ntp: Fixup adjtimex freq validation on 32-bit systems
[pandora-kernel.git]
/
kernel
/
time
/
ntp.c
diff --git
a/kernel/time/ntp.c
b/kernel/time/ntp.c
index
bca743d
..
34fd01e
100644
(file)
--- a/
kernel/time/ntp.c
+++ b/
kernel/time/ntp.c
@@
-608,10
+608,14
@@
int do_adjtimex(struct timex *txc)
return -EINVAL;
}
return -EINVAL;
}
- if (txc->modes & ADJ_FREQUENCY) {
- if (LONG_MIN / PPM_SCALE > txc->freq)
+ /*
+ * Check for potential multiplication overflows that can
+ * only happen on 64-bit systems:
+ */
+ if ((txc->modes & ADJ_FREQUENCY) && (BITS_PER_LONG == 64)) {
+ if (LLONG_MIN / PPM_SCALE > txc->freq)
return -EINVAL;
return -EINVAL;
- if (LONG_MAX / PPM_SCALE < txc->freq)
+ if (L
L
ONG_MAX / PPM_SCALE < txc->freq)
return -EINVAL;
}
return -EINVAL;
}