[PATCH 1/3] objtool: is_fentry_call() crashes if call has no destination

Rui Qi posted 3 patches 1 year, 11 months ago
There is a newer version of this series
[PATCH 1/3] objtool: is_fentry_call() crashes if call has no destination
Posted by Rui Qi 1 year, 11 months ago
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)
Re: [PATCH 1/3] objtool: is_fentry_call() crashes if call has no destination
Posted by Greg KH 1 year, 11 months ago
On Mon, Feb 26, 2024 at 05:49:23PM +0800, Rui Qi wrote:
> 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

When you forward a patch on for inclusion, you too have to sign off on
it.

Please do so for all of these commits.

And we recieved a few different copies of this series, please resend a
v2 series so we know which one is the correct one to review.

thanks,

greg k-h