Message ID | 20221028143346.183569-9-sv@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp870373wru; Fri, 28 Oct 2022 07:43:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46q7aBeaMRsNPB5BhzsNBipKC8uLYnazw5RDDOsbOhgvZuyQ5AvJlzwRpJ4gWD3gXWF0nl X-Received: by 2002:a17:902:d48e:b0:186:822e:d02d with SMTP id c14-20020a170902d48e00b00186822ed02dmr14382873plg.121.1666968193444; Fri, 28 Oct 2022 07:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666968193; cv=none; d=google.com; s=arc-20160816; b=dKCTgriAUCJDjsr7dxh0AbyK1Gg9emQhqc+CyoSwT+0RgQTl20Rwby60lP1O+cDw4+ VyXtl6N/wlQrixgrMQw3e1JmMKdRBAHw92pFOYTg/RIkwaDAFqS+GaFW23yPMmH0ihn4 TqvESQ8IrRI6AfKwVIfMmvfobidzHPQe5J8yJXjn4mosXfFRWvx7VqgD2oEsrRSdxKkS zcrRw5gLCTCB9XYUYaIz643Ggzi+ubfnIpaCVv94F9Zn8DQ4ikoYqp1XW14aeJtU4nWb Yx4jLOF0h+Lahl1uNVWKOJWXuYUMF9JetII3D1OBH9DPAv7JW8OBJc9owPFX6V/fggoc cE3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0Civ+DEWBBFxAbNIAfT5jeBxtf9KMTFC6kEHjb+rDFM=; b=PqDTEjM3l29iR0UEWSIzXU1BI+IzzkqVDQh6RmzH2nldashICM6mxdqVL0gROMAcQJ jA7lrpK/ccr9ORFbGZJEfUbF9mtNA6eP5L1ftu+qRZfcy8auX+ewDld/wFAwt4cDjcoV 1SX1AU+R6GFPp1rgUgvLg4vx74JoEXV7KS1PacZTshBPdgMuHhgZgVSodx+v82WqizWX 3dYLBLsKGjpjRceI3Ju0Kj0nPE2WWCuKtuOdfjOqKDV1xN8v+kCoodj7xd2VaLhwF8YU hKVmVF5H+zzBgunFkPLceOnomOQ73uEhktdZPCqer66QQ3auSu1TIpTPT5gKpgVS+4Sl vx7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=fHcCkemU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d13-20020a170902f14d00b001869b2c5f47si1659721plb.326.2022.10.28.07.42.58; Fri, 28 Oct 2022 07:43:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=fHcCkemU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229458AbiJ1Ofi (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Fri, 28 Oct 2022 10:35:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbiJ1OfW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Oct 2022 10:35:22 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F236D6B165 for <linux-kernel@vger.kernel.org>; Fri, 28 Oct 2022 07:35:09 -0700 (PDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29SEBumb005249; Fri, 28 Oct 2022 14:34:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=0Civ+DEWBBFxAbNIAfT5jeBxtf9KMTFC6kEHjb+rDFM=; b=fHcCkemU1jxtTuujV4eQmTCSZRdppkYE/pI8lzwpjgQk55122A3n6aYnt82V/nux4vt8 gh8CXw48Ne6d16RLRD5twq0DA1INwkgnDYIx6jd3zXc+Fp8N8HoEQB+wC2FWkyZhEZTD ZWTc8CIK49sg2gO5GtxGkCfin6NMReA3DORorB7H9lhC5hfdk9LBHs58O3zkSZa3EngT jfhuhYoNI3814Z8fGawuQLK+/rzCLlKU1VwFKRSyxfry6nijCgqTcMKVwQUadEcQJHuQ 6Z3gtvPL5DODEqa7aBz4zK1Cbt/EYrrh8XY4kcJSevoPKXZTOB7rD96Y7b3NxDRecetH xw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3kgfhnu6t3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Oct 2022 14:34:54 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 29SEC3dN006094; Fri, 28 Oct 2022 14:34:53 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3kgfhnu6qh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Oct 2022 14:34:53 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 29SEKq8R010392; Fri, 28 Oct 2022 14:34:51 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma03fra.de.ibm.com with ESMTP id 3kfahp2pnn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Oct 2022 14:34:51 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 29SEYnMm64749866 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Oct 2022 14:34:49 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 20CDCA4051; Fri, 28 Oct 2022 14:34:49 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 64835A404D; Fri, 28 Oct 2022 14:34:45 +0000 (GMT) Received: from li-c3569c4c-1ef8-11b2-a85c-ee139cda3133.ibm.com.com (unknown [9.43.124.163]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 28 Oct 2022 14:34:45 +0000 (GMT) From: Sathvika Vasireddy <sv@linux.ibm.com> To: linuxppc-dev@lists.ozlabs.org Cc: jpoimboe@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org, aik@ozlabs.ru, mpe@ellerman.id.au, mingo@redhat.com, christophe.leroy@csgroup.eu, rostedt@goodmis.org, mbenes@suse.cz, npiggin@gmail.com, chenzhongjin@huawei.com, naveen.n.rao@linux.vnet.ibm.com, sv@linux.ibm.com Subject: [PATCH v5 08/16] objtool: Fix SEGFAULT Date: Fri, 28 Oct 2022 20:03:38 +0530 Message-Id: <20221028143346.183569-9-sv@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221028143346.183569-1-sv@linux.ibm.com> References: <20221028143346.183569-1-sv@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: jUqm20iSu0V6wUTU-HwrYuPtSOE3PKR4 X-Proofpoint-ORIG-GUID: p5FnY69AvPV4wydgbgw2FkwsBYvRHLCV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-28_07,2022-10-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=982 spamscore=0 impostorscore=0 bulkscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2210280090 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747942840300006971?= X-GMAIL-MSGID: =?utf-8?q?1747942840300006971?= |
Series |
objtool: Enable and implement --mcount option on powerpc
|
|
Commit Message
Sathvika Vasireddy
Oct. 28, 2022, 2:33 p.m. UTC
From: Christophe Leroy <christophe.leroy@csgroup.eu> find_insn() will return NULL in case of failure. Check insn in order to avoid a kernel Oops for NULL pointer dereference. Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> --- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 43ec14c29a60..8427af808221 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -207,7 +207,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, return false; insn = find_insn(file, func->sec, func->offset); - if (!insn->func) + if (!insn || !insn->func) return false; func_for_each_insn(file, func, insn) {