Received: by 10.213.65.68 with SMTP id h4csp1158382imn; Wed, 21 Mar 2018 04:14:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELua6pnULJA+b1llyff0fT9mCyAz1Q8YkdDdaNkXKPMmlug3Q5ycdT7dKVZ9mVyBtTSc85Jz X-Received: by 10.101.83.199 with SMTP id z7mr14959094pgr.105.1521630890735; Wed, 21 Mar 2018 04:14:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521630890; cv=none; d=google.com; s=arc-20160816; b=W7X0NKZ4SzzwIIsejPVLg8E11mszLVI9sY7vaOvgC03KS6M6YEIlg9pfGpHsE/HSd0 YLnVk0YUO4AGYmTCXZRFdqzxegh5uN45GnZSrJM7eQ289QkNH2OpxSxXKAUYSny7L2nX XyiaQb0yiIhJixP8tzbExqBOUWokTII0CLtJTQMi0FQz6gR1A9UTYVyIf1lItZKvUjGl vWatFKEHEZo4owhvlklLYTTJbNCCZcGoNdp8k+yuWKucyDHPzTdz270lKBQqHzR50+hr 7haPX+Ij9MyBWqkRMbskhbhpF2+Op7dbTskRyF3ImqDJA4qh6cHf+QCD97qd7cuywQYP x3AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=O8Ua5l55I5DsIHKv+b6z1kU9o2V6MkPzhD47xAK0vQo=; b=dYZHi5dY8eSZGXeocRDbV3hDxawi5AhfnWYCpF6geQaoo/cZ1e6xNQknRQD6lTNIgC okhb9bMHqKhiglXwg+sgjSSOfalxhFYcfaoV5fCXQShxDZCAk3vMfSScY/c8DnvDgfHr sXd0WT63WSime9u7Kuc0uQjZX62TPnHvOQb9fxGPO9n4gHRYGv2pY3f1ubdseAGiPDkz HBk+sXIjtiVLXg+NSdf3hj79KW3rVFLYVscraIJEH/0IoJ+fxiAw0O8VUInxUtDwU6qi bf1XK85P4jUlsTBbXaxRI3h1NSw6KYCebGDuZ/lp1YcNZqN7AdjKgOlBp6K3isuPfOvn lBqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=B/XVL2Qg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a190si2627897pge.436.2018.03.21.04.14.35; Wed, 21 Mar 2018 04:14:50 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=B/XVL2Qg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751857AbeCULLp (ORCPT + 99 others); Wed, 21 Mar 2018 07:11:45 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:19533 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751719AbeCULLm (ORCPT ); Wed, 21 Mar 2018 07:11:42 -0400 Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20180321111139epoutp014237da7e2369ede8171f89e8c8b431da~d6w9Ftxux0514905149epoutp01T for ; Wed, 21 Mar 2018 11:11:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180321111139epoutp014237da7e2369ede8171f89e8c8b431da~d6w9Ftxux0514905149epoutp01T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1521630699; bh=O8Ua5l55I5DsIHKv+b6z1kU9o2V6MkPzhD47xAK0vQo=; h=From:To:Cc:Subject:Date:References:From; b=B/XVL2QgDVj/T6FYfg0XLDB0vHLgF7bRj+cl13NweXUAVRXpE25hOSbJ+sucpsTbN kHKYL/47pn0UgmiRIaDxSmhVtKY4B8PqhxVLa7P8WfUDyTFipexMntbeR3hVIKvNyE Mt2YksClffWX+mlcV23TWkA1EpHsfU4sQvJT2dx8= Received: from epsmges5p1new.samsung.com (unknown [182.195.40.77]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20180321111139epcas5p225c24bcae00d531f530b7d2501cd420c~d6w8s_iZ40095400954epcas5p2P; Wed, 21 Mar 2018 11:11:39 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id B1.B4.04386.BED32BA5; Wed, 21 Mar 2018 20:11:39 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20180321111139epcas5p4d5b75f4e1b572ae4e55aef737cd6d8e9~d6w8Plo311815718157epcas5p4k; Wed, 21 Mar 2018 11:11:39 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180321111138epsmtrp22836e4645e5e23c6584620b11811dbe4~d6w8LrGrE3102931029epsmtrp2J; Wed, 21 Mar 2018 11:11:38 +0000 (GMT) X-AuditID: b6c32a49-025ff70000001122-2c-5ab23deb8cfc Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id C1.9E.03698.AED32BA5; Wed, 21 Mar 2018 20:11:38 +0900 (KST) Received: from localhost.localdomain (unknown [107.108.92.210]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180321111134epsmtip275731712e058ff73a7e471ff4291abae~d6w3wTo891747617476epsmtip2B; Wed, 21 Mar 2018 11:11:33 +0000 (GMT) From: Maninder Singh To: linux@armlinux.org.uk, dustinb@codeaurora.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, a.sahrawat@samsung.com, pankaj.m@samsung.com, Maninder Singh , Vaneet Narang Subject: [PATCH v2] arm/stacktrace: stop unwinding after an invalid address. Date: Wed, 21 Mar 2018 16:40:45 +0530 Message-Id: <1521630645-46715-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0hTcRTH+e1udzdrcZtmp0k2LvSHwubu2PQuXA8SWyVhT2hR66K/1HJ3 496ZGVSWZWFZ2eMfcxRYlgaZjyxmQk2yxDDMspf0fr+oZtKDqF2v0X/fc76f8+BwKEL/RmOg CoQAFgW+kCFj1G2dScmm985mt+VAnYHra8fc6z21JNf8fEDD9YdqSC58pANxncfK1dyjD+dV XLg7iGZRrv6BPsLVv69S5Wo5sdW1r7UBuSLNidkaN07Px3wuFo1YyPHlFgh5TmbBEs8cjz3V wppYB5fGGAXei51MRla2KbOgMLoJY9zAFxZFU9m8JDEpM9JFX1EAG/N9UsDJrGRZq5m1pJmt VqvZZl813WqPImtwft3wXa3/JLXxdtcgKkXbtBWIooC2we8XEypQDKWn2xEEh1pRBRoTDb4i uNibphjDCHrOPiRkQy6oCh8lFaMDwZ7gIbUSDCE4+Xk/KVMkbYaG0CW1rONoFpre1SMZIujr CL5f+KGSjVg6C0K1H0YgNT0NSkvvaGWto+fCzcflamVcInR3HdLIxUBvIyG4f6dKWTwDjjws UZhYeHetVatoA0Q+dZAKX4Zg8PQ3QgkOI/gafDradSY8uXd15AIEnQSNoRQl7YSD4cgIQtDj ofLXi9FZOthdrleQabDj/jmNohMg8uXLaEcX3GupRIqeDb0PbmnkUj29CjpfFh9AidX/Zx1H qAFNxn7Jm4clu58VcLFZ4r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: 20180321111139epcas5p4d5b75f4e1b572ae4e55aef737cd6d8e9 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-MTR: 20180321111139epcas5p4d5b75f4e1b572ae4e55aef737cd6d8e9 CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180321111139epcas5p4d5b75f4e1b572ae4e55aef737cd6d8e9 X-RootMTR: 20180321111139epcas5p4d5b75f4e1b572ae4e55aef737cd6d8e9 References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch stops unwinding backtrace in case address does not belong to kernel address like below:- .... __do_fault+0x4c/0xa8 handle_mm_fault+0xb74/0x11c0 do_page_fault+0x29c/0x38c do_DataAbort+0x40/0xb8 __dabt_usr+0x44/0x60 0xb6748ea4 ^^^^^^^^ So this patch discards last junk entry. Signed-off-by: Maninder Singh Signed-off-by: Vaneet Narang --- v1->v2: https://lkml.org/lkml/2017/10/24/378 (take care of IRQ taken in SVC mode) arch/arm/kernel/stacktrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c index a56e7c8..1aadffc 100644 --- a/arch/arm/kernel/stacktrace.c +++ b/arch/arm/kernel/stacktrace.c @@ -92,6 +92,9 @@ static int save_trace(struct stackframe *frame, void *d) regs = (struct pt_regs *)frame->sp; + if (!__kernel_text_address(regs->ARM_pc)) + return 1; + trace->entries[trace->nr_entries++] = regs->ARM_pc; return trace->nr_entries >= trace->max_entries; -- 1.9.1