From: "$(name)" <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, qirui.001@bytedance.com
Subject: [PATCH 1/3] objtool: is_fentry_call() crashes if call has no destination
Date: Mon, 26 Feb 2024 17:40:59 +0800 [thread overview]
Message-ID: <20240226094101.95544-2-qirui.001@bytedance.com> (raw)
In-Reply-To: <20240226094101.95544-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
---
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.39.2 (Apple Git-143)
next prev parent reply other threads:[~2024-02-26 9:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-26 9:40 [PATCH 0/3] Support intra-function call validation $(name)
2024-02-26 9:40 ` $(name) [this message]
2024-02-26 9:41 ` [PATCH 2/3] objtool: Add support for intra-function calls $(name)
2024-02-26 9:41 ` [PATCH 3/3] x86/speculation: Support intra-function call validation $(name)
2024-02-26 10:06 ` kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2024-02-26 9:49 [PATCH 0/3] " Rui Qi
2024-02-26 9:49 ` [PATCH 1/3] objtool: is_fentry_call() crashes if call has no destination Rui Qi
2024-02-26 13:29 ` 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=20240226094101.95544-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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.