Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753344AbaBXRlF (ORCPT ); Mon, 24 Feb 2014 12:41:05 -0500 Received: from merlin.infradead.org ([205.233.59.134]:45275 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752552AbaBXRlD (ORCPT ); Mon, 24 Feb 2014 12:41:03 -0500 Date: Mon, 24 Feb 2014 18:40:51 +0100 From: Peter Zijlstra To: Vince Weaver Cc: "H. Peter Anvin" , Linux Kernel , Ingo Molnar , "H.J. Lu" , Steven Rostedt Subject: Re: perf_fuzzer compiled for x32 causes reboot Message-ID: <20140224174051.GE9987@twins.programming.kicks-ass.net> References: <530AD71E.50800@zytor.com> <18f0cea3-7e3b-4477-b433-0269f3de976b@email.android.com> <20140224172536.GD9987@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 24, 2014 at 12:32:39PM -0500, Vince Weaver wrote: > I do note that > perf_callchain_user(); > > Does > fp = (void __user *)regs->bp; > > ... > > bytes = copy_from_user_nmi(&frame, fp, sizeof(frame)); > > > And in my particular executable RBP has nothing to do with a frame > pointer, but is instead being used as a general purpose register. > > Am I missing something here? Though in that case I'm not sure why this > wouldn't be easier to trigger. Ah, in case the frame doesn't actually exist we would expect to fault and get the fixup treatment, returning a short copy (the return value being bytes _NOT_ copied). When that happens; if (bytes != 0) break; At which point we'll terminate the stack frame iteration. This is where we rely on being able to take a fault from NMI context, the fault iret will re-enable NMIs, necessitating all the magic Steve did. -- 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/