From patchwork Sat Aug 6 12:23:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12938012 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92150C19F2D for ; Sat, 6 Aug 2022 12:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LspEUKZYHTbBW4h2GKLL1uuPpbTl9fwcUX522hvr5wA=; b=NposhCF7BAEcH5 ziYbdJuuHrPJgETaM5Z6fRrHIRzhSh2Ti1doOP2c/Wb1ThtiCRnz1Yb0qLoloPXOVd1HmXHs6xD6T fqn9kZLBd1JAgk84KIpTjj80ZAFczcjf/Tc8tzPRnbsytfc3HUwzJZIc7vchwrJTCi3ryoSgevauN 8e/1bU/BgG9HrtG0l/WjAad/huWRJw4OOlH+BpICRlk+8kge3Q1mKmpnnjz1pVDADWPSylJY+Ltwx L3xeMyQGEpHjodSRSvOUwCve9CvkBKLJ0DlJMs5r3C5x+Faez8EZ8OtRDapVlZT40P0DDwY+wZm5i v7jjbz/esQFFe/Qhc78g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKIr0-00AvZB-St; Sat, 06 Aug 2022 12:24:31 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKIqX-00AtiF-KZ for linux-arm-kernel@lists.infradead.org; Sat, 06 Aug 2022 12:24:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1659788631; bh=UovwDaLyuTgPejCzTK254N9IC9/vqRLIfV2J6pi3cos=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=a9fwassgbNp/eFsORC6vomzhKQDhM2K8+UJAIwEB9sRSM/3dzp1j7fyflsow33MYF 81aazw3OzfsNl6ui8/QyG4e5LKsg7vYFTm4tOyYaRVdNpFBhk+REgBHtR4mBbH/8S9 3Q9m7MENLt3DMs53shyio87/m3N1AzEI6lAz96U4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.170.46]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M4axg-1oIePp13Oo-001li5; Sat, 06 Aug 2022 14:23:51 +0200 From: Helge Deller To: linux-s390@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, Josh Triplett , linux-fsdevel@vger.kernel.org Subject: [PATCH v2 3/3] x86/fault: Dump command line of faulting process to syslog Date: Sat, 6 Aug 2022 14:23:48 +0200 Message-Id: <20220806122348.82584-4-deller@gmx.de> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220806122348.82584-1-deller@gmx.de> References: <20220806122348.82584-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:H01j2TQ/vI8Y6o0FFlkaFoyN427aLLFHAXOwrAp0nDGTiiV7Nq+ uCJbOe9koCgQtLpU+9nuzPCG4KZT80QhBUZIcSt8TR3Db2qFjW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z0h2 dYotQtIWlRvztIDUBA0Rnlz8Y8dA60P+wMhJrMKVXrL7xWToL80BG5fM6h2FOkgxbPs3ShCrq rYV6VgQV5wbCshM5AMOnROdzeFIx2VVrDnaEcd+kADRRbeI8Btg7sEZdSCOZPyDGbCzYxwqIe 4FWCjuAkbzgoKvVeR8djCtioKWsyhRFSjmzlANc/2lCLleM53lo2kXNjD5CyscAr37vMHgh5d mmzrgSNKS+PGv5ksMyyaCwp95m5BguKuzWtK1ksb3Xr3XftOpw1NtWW8Q== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220806_052402_006531_380CC5D4 X-CRM114-Status: GOOD ( 10.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org If a process segfaults, include the command line of the faulting process in the syslog. In the example below, the "crash" program (which simply writes zero to address 0) was called with the parameters "this is a test": crash[2326]: segfault at 0 ip 0000561a7969c12e sp 00007ffe97a05630 error 6 in crash[561a7969c000+1000] crash[2326] cmdline: ./crash this is a test Code: 68 ff ff ff c6 05 19 2f 00 00 01 5d c3 0f 1f 80 00 00 00 00 c3 0f 1f 80 00 00 00 00 e9 7b ff ff ff 55 48 89 e5 b8 00 00 00 00 00 01 00 00 00 b8 00 00 00 00 5d c3 0f 1f 44 00 00 41 57 4c 8d Signed-off-by: Helge Deller --- arch/x86/mm/fault.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.37.1 diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index fad8faa29d04..d4e21c402e29 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -784,6 +784,8 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code, printk(KERN_CONT "\n"); + dump_stack_print_cmdline(loglvl); + show_opcodes(regs, loglvl); }