kexec: prevent double free on image allocation failure
[deliverable/linux.git] / kernel / posix-timers.c
index 10349d5f2ec311afe81c17ff533aec6ddbd83d09..7edfe4b901e7a7487f65d3704034ce8148f748fc 100644 (file)
@@ -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) {
This page took 0.028512 seconds and 5 git commands to generate.