diff options
| author | 2013-02-26 19:43:20 -0800 | |
|---|---|---|
| committer | 2013-02-26 19:43:20 -0800 | |
| commit | 24e55910e4801d772f95becde20b526b8b10388d (patch) | |
| tree | fe02c8e39d21e940562624e95fbe6641a590e734 /kernel/posix-timers.c | |
| parent | Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (diff) | |
| parent | clocksource : Nomadik-mtu : fix missing irq initialization (diff) | |
| download | wireguard-linux-24e55910e4801d772f95becde20b526b8b10388d.tar.xz wireguard-linux-24e55910e4801d772f95becde20b526b8b10388d.zip | |
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Ingo Molnar.
* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
clocksource : Nomadik-mtu : fix missing irq initialization
posix-timer: Don't call idr_find() with out-of-range ID
Diffstat (limited to '')
| -rw-r--r-- | kernel/posix-timers.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 10349d5f2ec3..7edfe4b901e7 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c @@ -639,6 +639,13 @@ static struct k_itimer *__lock_timer(timer_t timer_id, unsigned long *flags) { struct k_itimer *timr; + /* + * timer_t could be any type >= int and we want to make sure any + * @timer_id outside positive int range fails lookup. + */ + if ((unsigned long long)timer_id > INT_MAX) + return NULL; + rcu_read_lock(); timr = idr_find(&posix_timers_id, (int)timer_id); if (timr) { |
