hrtimer: check relative timeouts for overflow

Various user space callers ask for relative timeouts. While we fixed
that overflow issue in hrtimer_start(), the sites which convert
relative user space values to absolute timeouts themself were uncovered.

Instead of putting overflow checks into each place add a function
which does the sanity checking and convert all affected callers to use
it.

Thanks to Frans Pop, who reported the problem and tested the fixes.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Tested-by: Frans Pop <elendil@planet.nl>
This commit is contained in:
Thomas Gleixner
2008-02-13 09:20:43 +01:00
parent e760e716d4
commit 5a7780e725
5 changed files with 29 additions and 22 deletions

View File

@@ -310,6 +310,8 @@ static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec)
return ktime_sub_ns(kt, usec * 1000);
}
extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
/*
* The resolution of the clocks. The resolution value is returned in
* the clock_getres() system call to give application programmers an