Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752244AbZIRToT (ORCPT ); Fri, 18 Sep 2009 15:44:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751981AbZIRToP (ORCPT ); Fri, 18 Sep 2009 15:44:15 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:52363 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750712AbZIRToO (ORCPT ); Fri, 18 Sep 2009 15:44:14 -0400 Date: Fri, 18 Sep 2009 20:44:03 +0100 From: Russell King - ARM Linux To: =?iso-8859-1?Q?Fr=E9d=E9ric?= RISS Cc: Nicolas Pitre , Linux Kernel list , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm: Make kprobes unregistration SMP safe Message-ID: <20090918194403.GC6601@n2100.arm.linux.org.uk> References: <1253078476.5021.65.camel@funkybook> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1278 Lines: 27 On Thu, Sep 17, 2009 at 08:40:10PM -0400, Nicolas Pitre wrote: > On Wed, 16 Sep 2009, Fr?d?ric RISS wrote: > > > ARM kprobes use an illegal instruction to trigger kprobes. In the > > current implementation, there's a race between the unregistration of a > > kprobe and the illegal instruction exception handler if they run at the > > same time on different cores. > > > > When reading the value of the undefined instruction, the exception > > handler might get the original legal instruction as just patched > > concurrently by arch_disarm_kprobe(). When this happen the kprobe > > handler won't run, and thus the exception handler will oops because it > > believe it just hit an undefined instruction in kernel space. > > > > The following patch synchronizes the code patching in the kprobes > > unregistration using stop_machine and thus avoids the above race. > > > > Signed-off-by: Frederic RISS > > Acked-by: Nicolas Pitre Fr?d?ric, please submit to the patch system, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/