lkml.org 
[lkml]   [2023]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 1/3] Revert "x86/retpoline: Remove .text..__x86.return_thunk section"
Date
[AMD Official Use Only - General]

> -----Original Message-----
> From: Josh Poimboeuf <jpoimboe@kernel.org>
> Sent: Tuesday, October 10, 2023 3:19 PM
> To: Borislav Petkov <bp@alien8.de>
> Cc: Peter Zijlstra <peterz@infradead.org>; Kaplan, David
> <David.Kaplan@amd.com>; x86@kernel.org; luto@kernel.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH 1/3] Revert "x86/retpoline: Remove
> .text..__x86.return_thunk section"
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Tue, Oct 10, 2023 at 10:04:29PM +0200, Borislav Petkov wrote:
> > On Tue, Oct 10, 2023 at 12:57:21PM -0700, Josh Poimboeuf wrote:
> > > Also we could make objtool properly detect the non-relocated jump
> > > target.
> >
> > I was wondering about that... I guess it can compute the JMP target
> > and compare it to the address of __x86_return_thunk?
>
> Fine, you twisted my arm ;-)
>
> This seems to do the trick. Lemme write up a proper patch.
>
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c index
> e308d1ba664e..6cbc9812a36e 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -1610,6 +1610,11 @@ static int add_jump_destinations(struct
> objtool_file *file)
> return -1;
> }
>
> + if (jump_dest->sym && jump_dest->sym->return_thunk) {
> + add_return_call(file, insn, true);
> + continue;
> + }
> +
> /*
> * Cross-function jump.
> */

This looks good to me in my testing so far.

--David Kaplan
\
 
 \ /
  Last update: 2023-10-10 22:41    [W:0.847 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site