[PATCH] clocksource: mtk: Fix race conditions in probe code

Daniel Lezcano daniel.lezcano at linaro.org
Mon Feb 23 23:16:08 PST 2015


On 02/19/2015 11:41 AM, Matthias Brugger wrote:
> We have two race conditions in the probe code which could lead to a null
> pointer dereference in the interrupt handler.
>
> The interrupt handler accesses the clockevent device, which may not yet be
> registered.
>
> First race condition happens when the interrupt handler gets registered before
> the interrupts get disabled. The second race condition happens when the
> interrupts get enabled, but the clockevent device is not yet registered.
>
> Fix that by disabling the interrupts before we register the interrupt and enable
> the interrupts after the clockevent device got registered.
>
> Reported-by: Gongbae Park <yongbae2 at gmail.com>
> Signed-off-by: Matthias Brugger <matthias.bgg at gmail.com>
> Cc: stable at vger.kernel.org
> ---

Applied to my tree as a fix for 3.20.

Thanks !

   -- Daniel

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog




More information about the linux-arm-kernel mailing list