Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3487165ybi; Tue, 2 Jul 2019 08:34:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMijg5qooTL+AfommZoUTGtMWTeFWq/VwcdqtmKkYlrAONfRiiISR7rpUWwJ0KLZy6TzkI X-Received: by 2002:a17:90a:cb12:: with SMTP id z18mr6023829pjt.82.1562081682797; Tue, 02 Jul 2019 08:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562081682; cv=none; d=google.com; s=arc-20160816; b=T1lIHJGAMptNmTHiuKxuDIe9o/9MMF+3cKbiTUuUBRs9aAp59NIYRLQkUB+PhLjcbA cBH9nv9md+Mk3eItBOMjif9J+Z9Rpy75pwlhuJ7P02QG/QSQLIebD+DKPH0G/3va8zes KgHiVPebrzVThvaMEGO1de6U8biT8nkxMLQYzd+B7b6GYgf2OYtzN6lPDdcIwk9BjuJ8 T1FRcIUaEApGIrgkr9ZqRLHREbo4iJsnDgcRsJqMAOrb1d3wYNfGylzAffuyCSaMcT0j b5YTi1NhUTAjVbWtFllUzjPaOgcPTPRY5lNtA8QBxCAfo1dTjQ8FQl0AnE7x7jBF/bC1 3V1A== 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=eGRE2jzn0exMqa1essgyV1Sk+dz/H36SmzyJwLGlDGo=; b=A0iHpPnP8C6PxTieYMnsfq0HrF1QyotxKvBSBxnEgqcEpt0Y25qT5+56e5cf/U3XVu tV2sHRns8Typw+EYNNQwGTgau4aML2IikQ5UheyTmLbwUy/ECw9h1SMiUDXt90r9nCyG 2UwgE9Yt19USTOkflGRfXCyeL3klabseLCH54Xou4GSg/ehfXUL35URQ2kvttqBqryRn w8AaizNEvprmZ3+46DGSelVScMkzzTx8nzaRgKMOApR9DL3caN6cyP05CKddaWFXVXlk 1Ad3Porw31diLfEoSY5SVMgfeuvrBRAmrUP2hKlgGQE4macFRZ4HcuUDRI6xSzXumtnw cPgA== 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 j1si13885221pfr.52.2019.07.02.08.34.27; Tue, 02 Jul 2019 08:34:42 -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 S1726362AbfGBPd7 (ORCPT + 99 others); Tue, 2 Jul 2019 11:33:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:58088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbfGBPd7 (ORCPT ); Tue, 2 Jul 2019 11:33:59 -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 AD473206A3; Tue, 2 Jul 2019 15:33:57 +0000 (UTC) Date: Tue, 2 Jul 2019 11:33:55 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: Peter Zijlstra , Eiichi Tsukata , edwintorok@gmail.com, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Josh Poimboeuf Subject: Re: [PATCH] x86/stacktrace: Do not access user space memory unnecessarily Message-ID: <20190702113355.5be9ebfe@gandalf.local.home> In-Reply-To: References: <20190702053151.26922-1-devel@etsukata.com> <20190702072821.GX3419@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 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. -- Steve > > It triggers segfaults in random user processes which is bad enough. > > And even with that 'fix' applied I can see random segfaults just less > frequent. > > > > RIP: 0033:0x55be7ad1c89f > > > Code: Bad RIP value. > > > > ^^^ that's weird, no amount of unwinding should affect regs->ip. > >