Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp290226lqc; Thu, 7 Mar 2024 18:46:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX97ynb70Epfv3DIpEJOQoKZq/bc/lb3MuNmkpojOjU7XO6FuUnK2dJwdca781uaz0iEDTZ34TkTFVa0mRHAjzYvZsEYyvOLloPwDtF5w== X-Google-Smtp-Source: AGHT+IGIToQDoLnIClryBGVASaVGsYo6IACBao0eDkd8aPviL/JStutIQGPTlsFaVVuDbZZapcDf X-Received: by 2002:a05:620a:ccc:b0:788:1ddc:5483 with SMTP id b12-20020a05620a0ccc00b007881ddc5483mr10166948qkj.64.1709865990879; Thu, 07 Mar 2024 18:46:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709865990; cv=pass; d=google.com; s=arc-20160816; b=BfQO3oj7YZEBcvU7XsGkQ14yTNSUvbDqqQlA2NwkJtUxwEfKaAUXECuN4lijZo2XeG CwQAtYWyZrLnvLTQL84x+kFkilXkGKWPjTHf2ZgnsS5ucugY9mpZDQbEOSknDPcEtgN5 c2RFo2tsGmlezZVA10TC/is81FyV4bb1BgDqsf4rNUeA2aLRQORZPE8ornq0UgyJJ1mN UsVZeVMWMXRur7k/pgKTkPYg/ZyZkfd63ClHf2+CGJwqhDHUtEOXpyeGEUj+xZpb3W6d hKB3RZ8vy1PY7LHo174Oy5pJ9Ik7n+5SAUSn/fqOvMUizGQY8fHyTWvm3XrUQfu8wo77 t0tQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=g2bZO0fGsdGUR3z5kE6H/Hbx7vevj24u/qPVhihb39I=; fh=eDRGj/cWilCn2cqH9MNPp4Uv9XXD6HDLBH+EhlUItOk=; b=lgYuAAAv/wAZK6p7q1meA0476wBe2gY7Ne5lpolv+x2pnBTlCZzuzI5Tgwlx4WeFdx qUUp3HBOWM6pqdrUzwfvY2Mtk6foom+OTHMAZ6noxDLBlduHVs+Yc96RMetXuVg5/iw1 yjIFNvBX/+3hRoXh9TsxQ7hDkJq6BQ0/J/gxPygUz1KuvzQB8wOJkXbfwFMyfkoKb5Yc N4BiSCFdb6VXJ07RcnURboFG5UlZLkCSfuyOooDcP/j24WYKryB+LdnOwtdXwIi/dzEb /0zt1kN+F68Cg9MKi+8TwmTRAOZFcHntTPO4DxbH4CrmKC68PIV9EyuiUsI2HuPGopny ZydQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=OTvPK80o; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-96457-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k4-20020a05620a07e400b00788380b229csi6408663qkk.237.2024.03.07.18.46.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 18:46:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96457-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=OTvPK80o; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-96457-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8B1831C210C2 for ; Fri, 8 Mar 2024 02:46:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF6AA2C692; Fri, 8 Mar 2024 02:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="OTvPK80o" Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B9B52C1A7 for ; Fri, 8 Mar 2024 02:45:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709865952; cv=none; b=ACV1rKpoNTrKNzwn+v17qz9C9YE3sUMLRp3ZfPzpFsI/0MqiUOlEaxyvFZaqxigG9/CM4fLl6xPW2gENVRyGyLtQMbV+hSqhQf70zdl9u/Z5EIZyWOOMiIllLLz5TepCfmxZ/Lub1GnfSDZVCZ06R7AZx9O8x1kSF87shuPoOiE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709865952; c=relaxed/simple; bh=W5jnX+bgKVpgCXJLnqW/MWwdx7iLA8EDehVPIN+x1PE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hb1lL3+o/b1xC3UecAbRri6QDiVmMpTkmW20FdtxnuCQ96dZrTFL1oFwoI+uQgId4qgaMbwz2sLWCiewVq1zDm+D/qv6OE1Cpz/xARu9V4ttq+xPLVroX722TuEzkamBaIRERCuTYOSveVW0cWDlSssnwsMeBvFJ8Pb7Yl41/QA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=OTvPK80o; arc=none smtp.client-ip=209.85.210.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Received: by mail-pf1-f196.google.com with SMTP id d2e1a72fcca58-6e6277f72d8so1259189b3a.1 for ; Thu, 07 Mar 2024 18:45:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1709865950; x=1710470750; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g2bZO0fGsdGUR3z5kE6H/Hbx7vevj24u/qPVhihb39I=; b=OTvPK80oNGhj0mq/o+hdmPmmytRwnTsqS7e4aSaf7mjpa2yHJevU5cVz/VpzvPD6jo PbitksuxGdYHQnzw0+K3zhjYu6Hemx8vEueLymAK2GMWbL20UDrXXXUbVPz7hOFiFogg iBFLMn5zThv28PTKzL4H8Ky2kxKRbXRhLDVIMQJDPRfcfZfLUXBj5NNziNiiaXFLIlZ/ jXQFbOde7p86ZvEdXidKGB28zvAYDQoqX2XUhJDJ/+eu7DGvv2+/hNi3sh1d3Dj2rfa8 mQziUiPZ+3Vl7TV9I58XsedOmjobwO/WeKu1VWjijp07TAuyidaBiv+HysT7+f+wBOD1 9heA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709865950; x=1710470750; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g2bZO0fGsdGUR3z5kE6H/Hbx7vevj24u/qPVhihb39I=; b=BCLuQs0RD3ZH4uwLdZQrDJNRBUZjlU8UojNu9OShRjMxgO6iQ2/bWuMU24wM4PJ/SP uAAZRp1s4IlQ9cNnX0HoEoagu2jiknSTSs7gpu3H/ELfMm5hIdrfFn2wl5Z3Qeehhh4N dah1aDDtqiualJYcl8tOevNSEAAu4jWT6ibZeAPl/fs+esz8JfwnAl5WmN15dX22S+M5 mhECUTXmH2IAqT7kn1iu+G1WwgB6x14+mEZRi/yPfysGV+NyP4BxiqV1A58qKXfo3IOj QYBN5byaf97isX7B2lXMhdiV3ZI/KUZTQqdSwOqntyu+zSrbpW23cOCoITuhrcIsbwa9 TDMA== X-Forwarded-Encrypted: i=1; AJvYcCXmhL6qBKgriKsbZNnY24BD5DNRWBaYs/Fr+xGMI+etXK3T0W658WkBXs4N4GigfrJIpUg+FV/hGg3hkuPVgWLk7o9GaC0E3va7ZVbj X-Gm-Message-State: AOJu0YxIR6hZV6lCX2/nCWyP8rn7wACFCwhNeA88FL+UIQEEWhD7W/2q z07i0Aq5UJQjWOgDCzCaDAGnWamk/OzfHFUNyyxANXXDkk6dPVONLsQ2zZQeNbA= X-Received: by 2002:a05:6a20:244f:b0:1a1:7821:d012 with SMTP id t15-20020a056a20244f00b001a17821d012mr2882525pzc.26.1709865949817; Thu, 07 Mar 2024 18:45:49 -0800 (PST) Received: from C02CV19DML87.bytedance.net ([2001:c10:ff04:0:1000:0:1:4]) by smtp.gmail.com with ESMTPSA id q9-20020a170902b10900b001d8a93fa5b1sm15244360plr.131.2024.03.07.18.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 18:45:49 -0800 (PST) From: Rui Qi To: bp@alien8.de, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, jpoimboe@redhat.com, peterz@infradead.org, mbenes@suse.cz, gregkh@linuxfoundation.org, stable@vger.kernel.org, alexandre.chartre@oracle.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org, yuanzhu@bytedance.com, Rui Qi Subject: [PATCH v3 1/3] objtool: is_fentry_call() crashes if call has no destination Date: Fri, 8 Mar 2024 10:45:16 +0800 Message-Id: <20240308024518.19294-2-qirui.001@bytedance.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240308024518.19294-1-qirui.001@bytedance.com> References: <20240308024518.19294-1-qirui.001@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Alexandre Chartre commit 87cf61fe848ca8ddf091548671e168f52e8a718e upstream. Fix is_fentry_call() so that it works if a call has no destination set (call_dest). This needs to be done in order to support intra- function calls. Signed-off-by: Alexandre Chartre Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200414103618.12657-2-alexandre.chartre@oracle.com Signed-off-by: Rui Qi --- 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 dfd67243faac..71a24fd46dbd 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1367,7 +1367,7 @@ static int decode_sections(struct objtool_file *file) static bool is_fentry_call(struct instruction *insn) { - if (insn->type == INSN_CALL && + if (insn->type == INSN_CALL && insn->call_dest && insn->call_dest->type == STT_NOTYPE && !strcmp(insn->call_dest->name, "__fentry__")) return true; -- 2.20.1