linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org, Linus Torvalds <torvalds@linux-foundation.org>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Johannes Wikner <kwikner@ethz.ch>,
	Alyssa Milburn <alyssa.milburn@linux.intel.com>,
	Jann Horn <jannh@google.com>, "H.J. Lu" <hjl.tools@gmail.com>,
	Joao Moreira <joao.moreira@intel.com>,
	Joseph Nuzman <joseph.nuzman@intel.com>,
	Juergen Gross <jgross@suse.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH] lkdtm: Keep the rodata test from causing retbleed WARNINGS
Date: Wed, 20 Jul 2022 20:06:27 -0700	[thread overview]
Message-ID: <202207202006.46F304D45@keescook> (raw)
In-Reply-To: <20220720225809.wtnlgvof6wi4owkq@treble>

On Wed, Jul 20, 2022 at 03:58:09PM -0700, Josh Poimboeuf wrote:
> On Wed, Jul 20, 2022 at 03:56:18PM -0700, Josh Poimboeuf wrote:
> > On Wed, Jul 20, 2022 at 01:13:05PM -0700, Kees Cook wrote:
> > > On Wed, Jul 20, 2022 at 03:55:07PM -0400, Steven Rostedt wrote:
> > > > From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> > > > 
> > > > The rodata test checks if executable code in the .rodata section will not
> > > > execute. But this also means that fix ups that the return hook code does
> > > > will not be able to change this code at boot up, and this causes a
> > > > warning.
> > > > 
> > > > By removing the RETHOOK_CFLAGS from the compilation of the rodata function
> > > > makes it hidden from objtool and it will not add its return hook into the
> > > > .returns section. This keeps the fix up code from trying and failing on
> > > > modifying the rodata return call.
> > > > 
> > > > Link: https://lore.kernel.org/all/20220720125736.48164a14@gandalf.local.home/
> > > > 
> > > > Fixes: ee88d363d1561 ("x86,static_call: Use alternative RET encoding")
> > > > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> > > 
> > > Yeah, this matches a portion of what was suggested:
> > > https://lore.kernel.org/lkml/20220713213133.455599-1-keescook@chromium.org/
> > > 
> > > But it still needed objtool fixes:
> > > https://lore.kernel.org/lkml/20220715032333.neywlazczbb35w3b@treble/
> > > 
> > > Perhaps objtool has already had patches landed for this? (Otherwise the
> > > patch you suggested would fail to build on x86 with rethunk support.)
> > 
> > I send this patch out a few days ago, nobody picked it up yet:
> > 
> > https://lkml.kernel.org/lkml/8ec0039712f252693049c70ed3891d39a2357112.1658155446.git.jpoimboe@kernel.org
> 
> Actually Peter said he grabbed it and is planning to push it to -tip
> tomorrow.

Ah perfect; thank you!

-- 
Kees Cook

  reply	other threads:[~2022-07-21  3:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20 19:55 [PATCH] lkdtm: Keep the rodata test from causing retbleed WARNINGS Steven Rostedt
2022-07-20 20:13 ` Kees Cook
2022-07-20 22:56   ` Josh Poimboeuf
2022-07-20 22:58     ` Josh Poimboeuf
2022-07-21  3:06       ` Kees Cook [this message]
2022-07-21  8:47       ` Peter Zijlstra
2022-07-21 13:51         ` Steven Rostedt
2022-07-21 15:58           ` Peter Zijlstra
2022-07-21 16:21             ` Steven Rostedt

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=202207202006.46F304D45@keescook \
    --to=keescook@chromium.org \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=alyssa.milburn@linux.intel.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hjl.tools@gmail.com \
    --cc=jannh@google.com \
    --cc=jgross@suse.com \
    --cc=joao.moreira@intel.com \
    --cc=joseph.nuzman@intel.com \
    --cc=jpoimboe@kernel.org \
    --cc=kwikner@ethz.ch \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.org \
    --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;
as well as URLs for NNTP newsgroup(s).