From: Peter Zijlstra <peterz@infradead.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Ard Biesheuvel <ardb+git@google.com>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
keescook@chromium.org, linux-hardening@vger.kernel.org,
nathan@kernel.org, Josh Poimboeuf <jpoimboe@kernel.org>,
Jan Beulich <jbeulich@suse.com>,
"Jose E. Marchesi" <jemarch@gnu.org>, Kees Cook <kees@kernel.org>
Subject: Re: [PATCH v2 1/5] objtool: Deal with relative jump tables correctly
Date: Thu, 10 Oct 2024 16:07:45 +0200 [thread overview]
Message-ID: <20241010140745.GK17263@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <CAMj1kXFg+JWMrfw40y2=0f9jr-3ebUxsFPprAK5diK4GQke_4A@mail.gmail.com>
On Thu, Oct 10, 2024 at 03:59:43PM +0200, Ard Biesheuvel wrote:
> On Thu, 10 Oct 2024 at 15:26, Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Thu, Oct 10, 2024 at 02:28:03PM +0200, Ard Biesheuvel wrote:
> > > diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> > > index 3cb3e9b5ad0b..7f7981a93535 100644
> > > --- a/tools/objtool/check.c
> > > +++ b/tools/objtool/check.c
> > > @@ -2101,6 +2101,8 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn,
> > > {
> > > struct symbol *pfunc = insn_func(insn)->pfunc;
> > > struct reloc *table = insn_jump_table(insn);
> > > + unsigned int rtype = reloc_type(table);
> > > + bool pcrel = rtype == R_X86_64_PC32;
> >
> > R_DATA32 or R_TEXT32 please, the budding cross arch stuff has their own
> > names for all that.
> >
>
> #define R_DATA32 R_X86_64_PC32
> #define R_DATA64 R_X86_64_PC32
> #define R_TEXT32 R_X86_64_PC32
> #define R_TEXT64 R_X86_64_PC32
>
> Clear as mud.
>
> I'd guess we need the '64' variant here, but I'm not sure which one to
> use for a .rodata relocation pointing to .text. Any hints?
Josh? do R_{DATA,TEXT}64 want to be _PC64 ?
next prev parent reply other threads:[~2024-10-10 14:07 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 12:28 [PATCH v2 0/5] Improve objtool jump table handling Ard Biesheuvel
2024-10-10 12:28 ` [PATCH v2 1/5] objtool: Deal with relative jump tables correctly Ard Biesheuvel
2024-10-10 13:26 ` Peter Zijlstra
2024-10-10 13:59 ` Ard Biesheuvel
2024-10-10 14:07 ` Peter Zijlstra [this message]
2024-10-10 15:32 ` Josh Poimboeuf
2024-10-10 12:28 ` [PATCH v2 2/5] objtool: Allow arch code to discover jump table size Ard Biesheuvel
2024-10-10 19:52 ` Josh Poimboeuf
2024-10-11 16:50 ` Ard Biesheuvel
2024-10-10 12:28 ` [PATCH v2 3/5] objtool: Add support for annotated jump tables Ard Biesheuvel
2024-10-10 20:12 ` Josh Poimboeuf
2024-10-10 20:15 ` Josh Poimboeuf
2024-10-11 6:29 ` Ard Biesheuvel
2024-10-11 15:56 ` Josh Poimboeuf
2024-10-10 12:28 ` [PATCH v2 4/5] crypto: x86/crc32c - Use idiomatic relative jump table Ard Biesheuvel
2024-10-10 12:28 ` [PATCH v2 5/5] crypto: x86/crc32c - Tweak jump table to validate objtool logic Ard Biesheuvel
2024-10-10 20:34 ` Josh Poimboeuf
2024-10-11 6:32 ` Ard Biesheuvel
2024-10-11 16:04 ` Josh Poimboeuf
2024-10-11 16:22 ` Ard Biesheuvel
2024-10-10 17:50 ` [PATCH v2 0/5] Improve objtool jump table handling Ard Biesheuvel
2024-10-10 20:36 ` Josh Poimboeuf
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=20241010140745.GK17263@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=jbeulich@suse.com \
--cc=jemarch@gnu.org \
--cc=jpoimboe@kernel.org \
--cc=kees@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@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