Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp168717ybi; Tue, 2 Jul 2019 18:24:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTSrhnCk2a6XER7wgdUyXduXNgLI7tmNd3p9YRXQwGHywtx/U7lfvA6HPpgbi7bJ26HNKu X-Received: by 2002:a17:902:22e:: with SMTP id 43mr31457428plc.272.1562117096715; Tue, 02 Jul 2019 18:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562117096; cv=none; d=google.com; s=arc-20160816; b=dhcKwdzP3qH4WJ+i7lQJ61HupaiNETOCDLKjKaVoKCCtZObtQ76Z9Oca378LbOPfpw 7LhLeVp+dA1NsKfyEYwITQ/hXwMWkyaEoNSjK4j8fvuvhmf3+2TCmZpEWY1hkwUXyQ8u ImlGHBuFJbeBcYI3AawsOFy21Y5ZjzTtr/GKQSG160sfq3YpQe/vb5b31yU9KeHPoh35 SwnkInZlPpaIUMgH8tKTvtX632EXRZdFwOwzQVp2pnD6kuNAcZ9BbX/1rTO3JMFaQApu jHpSCKL7DZWi1yW4iIl0IZPH/IxMMspjWtGz1SKLuv0WLFSMBY6tF4G5fw6UsB+FNWJv 3fZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=ofmpvwBeIlkOzz6tCdGWImrcLlaD0mXJnV9ovc1n5ec=; b=Zwaqcff0LQS9+xWMXo3KYjaLnBkkj5ZkUqUFlzzuojVpX1mPoliQ3kaOTwoDI+IYom p/azBXWvleehYv5QiBehISLVnW7oHluJL2jVzTgKt/QhfbIbLR2D9d9BSJTF0h5eGFCM PzciVlwnMuuyMk2q1lBMm2iVhmtpi4MliVcR6AwnQvj9nba7hWebHUcXWXfv6yPrqBOZ 6TRxWdufD62E3MnAmetPoC7H8v76n1gtqw8byV5WIVSj4mX2JuIM3FOtwvrLHF+XvXs3 pnyeG6mT9WCjdnCMMgSeI0GSNUJW78Y5I17ib66ORDmKMjgvBo0jiag2BQ7NCcsIg3/c MlGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si438768pgo.310.2019.07.02.18.24.40; Tue, 02 Jul 2019 18:24:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727132AbfGCBXF (ORCPT + 99 others); Tue, 2 Jul 2019 21:23:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:33126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726430AbfGCBXF (ORCPT ); Tue, 2 Jul 2019 21:23:05 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 12B5B21897; Tue, 2 Jul 2019 20:33:57 +0000 (UTC) Date: Tue, 2 Jul 2019 16:33:56 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Thomas Gleixner , Eiichi Tsukata , edwintorok@gmail.com, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Josh Poimboeuf , Joel Fernandes Subject: Re: [PATCH] x86/stacktrace: Do not access user space memory unnecessarily Message-ID: <20190702163356.205bbe14@gandalf.local.home> In-Reply-To: <20190702201827.GF3402@hirez.programming.kicks-ass.net> References: <20190702053151.26922-1-devel@etsukata.com> <20190702072821.GX3419@hirez.programming.kicks-ass.net> <20190702113355.5be9ebfe@gandalf.local.home> <20190702133905.1482b87e@gandalf.local.home> <20190702201827.GF3402@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Jul 2019 22:18:27 +0200 Peter Zijlstra wrote: > On Tue, Jul 02, 2019 at 01:39:05PM -0400, Steven Rostedt wrote: > > On Tue, 2 Jul 2019 11:33:55 -0400 > > Steven Rostedt wrote: > > > > > On Tue, 2 Jul 2019 16:14:05 +0200 (CEST) > > > Thomas Gleixner wrote: > > > > > > > On Tue, 2 Jul 2019, Peter Zijlstra wrote: > > > > > > > > > On Tue, Jul 02, 2019 at 02:31:51PM +0900, Eiichi Tsukata wrote: > > > > > > Put the boundary check before it accesses user space to prevent unnecessary > > > > > > access which might crash the machine. > > > > > > > > > > > > Especially, ftrace preemptirq/irq_disable event with user stack trace > > > > > > option can trigger SEGV in pid 1 which leads to panic. > > > > > > Note, I'm only able to trigger this crash with the irq_disable event. > > > The irq_enable and preempt_disable/enable events work just fine. This > > > leads me to believe that the TRACE_IRQS_OFF macro (which uses a thunk > > > trampoline) may have some issues and is probably the place to look at. > > > > I figured it out. > > > > It's another "corruption of the cr2" register issue. The following > > Arrggghhh.. > > > patch makes the issue go away. I'm not suggesting that we use this > > patch, but it shows where the bug lies. > > > > IIRC, there was patches posted before that fixed this issue. I'll go > > look to see if I can dig them up. Was it Joel that sent them? > > https://lkml.kernel.org/r/20190320221534.165ab87b@oasis.local.home Oh, I wrote the patches. No wonder I couldn't find them in my local "patchwork". It doesn't include patches I write. But still, I completely forgot. Better send me to the nursing home :-p > > I think; lemme re-read that thread. I'll need to do that too. -- Steve