timers: limit heap size
authorJan Beulich <jbeulich@suse.com>
Mon, 2 Sep 2019 12:38:37 +0000 (14:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 2 Sep 2019 12:38:37 +0000 (14:38 +0200)
commit7ad6f2a9befcd4b0f1b51f26dcc2a86797de0fc6
tree9db7ddfaa8a0d0bf27dfb4913d928cff49aeef7d
parentb376456a78ce893036002186d1003900a3b8833d
timers: limit heap size

First and foremost make timer_softirq_action() avoid growing the heap
if its new size can't be stored without truncation. 64k entries is a
lot, and I don't think we're at risk of actually running into the issue,
but I also think it's better not to allow for hard to debug problems to
occur in the first place.

Furthermore also adjust the code such the size/limit fields becoming
unsigned int would at least work from a mere sizing point of view. For
this also switch various uses of plain int to unsigned int.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/timer.c