• akpm@osdl.org's avatar
    [PATCH] hrtimers: fix posix-timer requeue race · ff60a5dc
    akpm@osdl.org authored
    From: Steven Rostedtrostedt@goodmis.org <rostedt@goodmis.org>
    
    CPU0 expires a posix-timer and runs the callback function.  The signal is
    queued.
    
    After releasing the posix-timer lock and before returning to hrtimer_run_queue
    CPU0 gets interrupted.  CPU1 delivers the queued signal and rearms the timer.
    CPU0 comes back to hrtimer_run_queue and sets the timer state to expired.
    
    The next modification of the timer can result in an oops, because the state
    information is wrong.
    
    Keep track of state = RUNNING and check if the state has been in the return
    path of hrtimer_run_queue.  In case the state has been changed, ignore a
    restart request and do not touch the state variable.
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    ff60a5dc
hrtimer.c 18.3 KB