From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 62C8BDE109 for ; Tue, 19 Aug 2008 12:39:40 +1000 (EST) Subject: Re: ftrace introduces instability into kernel 2.6.27(-rc2,-rc3) From: Benjamin Herrenschmidt To: Steven Rostedt In-Reply-To: References: <48591941.4070408@extricom.com> <48A92E15.2080709@extricom.com> <48A9901B.1080900@redhat.com> <20080818154746.GA26835@Krystal> <48A9AFA7.8080508@freescale.com> <1219110814.8062.2.camel@pasglop> Content-Type: text/plain Date: Tue, 19 Aug 2008 12:39:09 +1000 Message-Id: <1219113549.8062.13.camel@pasglop> Mime-Version: 1.0 Cc: "Paul E. McKenney" , Mathieu Desnoyers , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, Steven Rostedt , Scott Wood , Eran Liberty Reply-To: benh@kernel.crashing.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > Hmm, this was originally copied from x86, where we did a cmpxchg, but that > is probably not needed since all of this is done in kstop_machine. Also, > only the "get" is needed. If we don't fault there, we wont fault on the > put (unless we have permissions wrong, and that would be a bug). Would it ? How do we make sure the kernel text is mapped writeable ? > So are you recommending something like > > int cmd; > > if (__get_user(cmd, ip)) > goto fault; > > if (cmd != old) > goto not_same; > > WARN_ON_ONCE(__put_user(cmd, ip)); > > If we did this, we could probably put this into the generic code: That would work I suppose, I'll give it a try. > if (copy_from_user(cmd, ip, ARCH_CALL_SIZE)) > goto fault; > > if (memcmp(cmd, old, ARCH_CALL_SIZE) != 0) > goto not_same; > > WARN_ON_ONCE(copy_to_user(cmd, ip, ARCH_CALL_SIZE)); You need the __ variants or the access_ok() checks will bite you bad. Ben.