From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752244AbbBXHQN (ORCPT ); Tue, 24 Feb 2015 02:16:13 -0500 Received: from mail-wi0-f182.google.com ([209.85.212.182]:35034 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225AbbBXHQM (ORCPT ); Tue, 24 Feb 2015 02:16:12 -0500 Message-ID: <54EC2538.1070005@linaro.org> Date: Tue, 24 Feb 2015 08:16:08 +0100 From: Daniel Lezcano User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Matthias Brugger , tglx@linutronix.de CC: yongbae2@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, stable@vger.kernel.org Subject: Re: [PATCH] clocksource: mtk: Fix race conditions in probe code References: <1424342493-31391-1-git-send-email-matthias.bgg@gmail.com> In-Reply-To: <1424342493-31391-1-git-send-email-matthias.bgg@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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@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