From: Rui Qi <qirui.001@bytedance.com>
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, sashal@kernel.org,
Rui Qi <qirui.001@bytedance.com>
Subject: [PATCH V3 RESEND 1/3] objtool: is_fentry_call() crashes if call has no destination
Date: Wed, 27 Mar 2024 17:44:45 +0800 [thread overview]
Message-ID: <20240327094447.47375-2-qirui.001@bytedance.com> (raw)
In-Reply-To: <20240327094447.47375-1-qirui.001@bytedance.com>
From: Alexandre Chartre <alexandre.chartre@oracle.com>
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 <alexandre.chartre@oracle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lkml.kernel.org/r/20200414103618.12657-2-alexandre.chartre@oracle.com
Signed-off-by: Rui Qi <qirui.001@bytedance.com>
---
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
next prev parent reply other threads:[~2024-03-27 9:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 9:44 [PATCH V3 RESEND 0/3] Support intra-function call validation Rui Qi
2024-03-27 9:44 ` Rui Qi [this message]
2024-03-27 9:44 ` [PATCH V3 RESEND 2/3] objtool: Add support for intra-function calls Rui Qi
2024-03-27 9:44 ` [PATCH V3 RESEND 3/3] x86/speculation: Support intra-function call validation Rui Qi
2024-03-29 10:16 ` [PATCH V3 RESEND 0/3] " Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240327094447.47375-2-qirui.001@bytedance.com \
--to=qirui.001@bytedance.com \
--cc=alexandre.chartre@oracle.com \
--cc=bp@alien8.de \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®