From mboxrd@z Thu Jan 1 00:00:00 1970 From: daniel.lezcano@linaro.org (Daniel Lezcano) Date: Tue, 24 Feb 2015 08:16:08 +0100 Subject: [PATCH] clocksource: mtk: Fix race conditions in probe code In-Reply-To: <1424342493-31391-1-git-send-email-matthias.bgg@gmail.com> References: <1424342493-31391-1-git-send-email-matthias.bgg@gmail.com> Message-ID: <54EC2538.1070005@linaro.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 > Signed-off-by: Matthias Brugger > Cc: stable at vger.kernel.org > --- Applied to my tree as a fix for 3.20. Thanks ! -- Daniel -- Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog