[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dvi4y6u7m2bo6jtesrerxu4sn5nbaw7xjkbnshjgvotvhsp6wa@i3hgg3nu46kj>
Date: Wed, 16 Jul 2025 13:48:49 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ard Biesheuvel <ardb@...nel.org>, Ard Biesheuvel <ardb+git@...gle.com>,
linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org, x86@...nel.org,
Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...nel.org>,
Kevin Loughlin <kevinloughlin@...gle.com>, Tom Lendacky <thomas.lendacky@....com>,
Nikunj A Dadhania <nikunj@....com>
Subject: Re: [PATCH v5 15/22] objtool: Add action to check for absence of
absolute relocations
On Wed, Jul 16, 2025 at 01:32:43PM +0200, Peter Zijlstra wrote:
> On Wed, Jul 16, 2025 at 08:26:55PM +1000, Ard Biesheuvel wrote:
>
> > For robustness, we should actually check for all absolute relocations
> > here, including R_X86_64_32S, which is not abstracted into a R_ABSxx
> > type for objtool.
> >
> > So perhaps this needs an arch hook where x86_64 can implement it as
> >
> > bool arch_is_abs_reloc(reloc)
> > {
> > switch (reloc_type(reloc)) {
> > case R_X86_64_32:
> > case R_X86_64_32S:
> > case R_X86_64_64:
> > return true;
> > }
> > return false;
> > }
> >
> > and the default just compares against R_ABS32 / R_ABS64 depending on
> > the word size?
>
> Yes, an arch hook like that makes sense. Perhaps make the signature:
>
> bool arch_is_abs_reloc(struct elf *, struct reloc *);
>
> Because the word size comes from elf_addr_size().
We already have an arch_pc_relative_reloc(), please try to keep the
naming consistent.
--
Josh
Powered by blists - more mailing lists