aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/domain.c
diff options
context:
space:
mode:
authorIan Jackson <Ian.Jackson@eu.citrix.com>2012-11-14 11:30:34 +0000
committerIan Jackson <Ian.Jackson@eu.citrix.com>2012-11-14 11:30:34 +0000
commitdfa0cb6a14b3c835e643f56b620137b5aff3e1c1 (patch)
tree72a632131081ca9f759f9b0a38d333cb5a9bae27 /xen/common/domain.c
parentb46c24edb7b8acba387b8621f867b7d4c5fce1b3 (diff)
downloadxen-dfa0cb6a14b3c835e643f56b620137b5aff3e1c1.tar.gz
xen-dfa0cb6a14b3c835e643f56b620137b5aff3e1c1.tar.bz2
xen-dfa0cb6a14b3c835e643f56b620137b5aff3e1c1.zip
VCPU/timers: Prevent overflow in calculations, leading to DoS vulnerability
The timer action for a vcpu periodic timer is to calculate the next expiry time, and to reinsert itself into the timer queue. If the deadline ends up in the past, Xen never leaves __do_softirq(). The affected PCPU will stay in an infinite loop until Xen is killed by the watchdog (if enabled). This is a security problem, XSA-20 / CVE-2012-4535. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'xen/common/domain.c')
-rw-r--r--xen/common/domain.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36aa1b..12c8e24e09 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -903,6 +903,9 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
if ( set.period_ns < MILLISECS(1) )
return -EINVAL;
+ if ( set.period_ns > STIME_DELTA_MAX )
+ return -EINVAL;
+
v->periodic_period = set.period_ns;
vcpu_force_reschedule(v);