Messages in this thread | | | Date | Wed, 20 Jul 2022 15:56:15 -0700 | From | Josh Poimboeuf <> | Subject | Re: [PATCH] lkdtm: Keep the rodata test from causing retbleed WARNINGS |
| |
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
-- Josh
| |