From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Kees Cook <keescook@chromium.org>,
kernel test robot <oliver.sang@intel.com>,
x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>, Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] x86: Allow for exclusions in checking RETHUNK
Date: Thu, 14 Jul 2022 20:23:33 -0700 [thread overview]
Message-ID: <20220715032333.neywlazczbb35w3b@treble> (raw)
In-Reply-To: <20220714185605.jo5iubnsgz6jr2wb@treble>
On Thu, Jul 14, 2022 at 11:56:07AM -0700, Josh Poimboeuf wrote:
> On Thu, Jul 14, 2022 at 11:50:08AM -0700, Josh Poimboeuf wrote:
> > On Thu, Jul 14, 2022 at 09:18:12AM +0200, Peter Zijlstra wrote:
> > > On Wed, Jul 13, 2022 at 04:55:56PM -0700, Josh Poimboeuf wrote:
> > > > Here's the ANNOTATE_UNSAFE_RET idea.
> > >
> > > Right, I suppose that strictly speaking the compiler can do whatever and
> > > there's no actual guarantee the annotation hits the RET instruction, in
> > > practise it should work, esp. since noinstr.
> >
> > Hm, KASAN is introducing a weird function, resulting in a naked return
> > warning since we have RETHUNK_CFLAGS removed on that file.
> >
> > 0000000000000000 <_sub_I_00099_0>:
> > 0: e8 00 00 00 00 call 5 <_sub_I_00099_0+0x5> 1: R_X86_64_PLT32 __tsan_init-0x4
> > 5: c3 ret
> >
> >
> > Looks like the "KASAN_SANITIZE_rodata.o := n" isn't working somehow?
>
> Oh never mind, I got KASAN/KCSCAN mixed up. Needs both disabled :-/
Well, my ANNOTATE_UNSAFE_RET trick didn't quite work either, as it
results in .discard.retpoline_safe pointing to .rodata when IBT is
enabled.
Instead I'll just do OBJECT_FILES_NON_STANDARD_rodata.o. That shouldn't
break LTO/IBT because the linked code lives in .rodata anyway.
Will have patches tomorrow, if they pass bot testing.
--
Josh
prev parent reply other threads:[~2022-07-15 3:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 21:31 [PATCH] x86: Allow for exclusions in checking RETHUNK Kees Cook
2022-07-13 23:55 ` Josh Poimboeuf
2022-07-14 7:18 ` Peter Zijlstra
2022-07-14 18:50 ` Josh Poimboeuf
2022-07-14 18:56 ` Josh Poimboeuf
2022-07-15 3:23 ` Josh Poimboeuf [this message]
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=20220715032333.neywlazczbb35w3b@treble \
--to=jpoimboe@kernel.org \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oliver.sang@intel.com \
--cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox