lkml.org 
[lkml]   [2018]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: objtool warnings on 4.14-stable/gcc-7.3.0
On Wed, Feb 14, 2018 at 04:45:25PM -0600, Josh Poimboeuf wrote:
> On Wed, Feb 14, 2018 at 04:24:12PM -0600, Josh Poimboeuf wrote:
> > On Wed, Feb 14, 2018 at 04:11:15PM +0100, Arnd Bergmann wrote:
> > > crypto/asymmetric_keys/x509_cert_parser.o: warning: objtool:
> > > x509_note_pkey_algo()+0xa4: sibling call from callable instruction
> > > with modified stack frame
>
> From a quick glance, this looks like yet another switch statement
> detection issue. I'll need to dig into it more (unless PeterZ, my shiny
> new co-maintainer, wants to take a look!)

Arnd, can you test this fix?

----

From: Josh Poimboeuf <jpoimboe@redhat.com>
Subject: [PATCH] objtool: Another switch table detection fix

Continue the switch table detection whack-a-mole. Add a check to
distinguish KASAN-related .rodata reads from switch-related .rodata
reads in GCC 7.

This fixes the following warning:

crypto/asymmetric_keys/x509_cert_parser.o: warning: objtool: x509_note_pkey_algo()+0xa4: sibling call from callable instruction with modified stack frame

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
tools/objtool/check.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 472e64e95891..46c1d239cc1b 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -925,7 +925,11 @@ static struct rela *find_switch_table(struct objtool_file *file,
if (find_symbol_containing(file->rodata, text_rela->addend))
continue;

- return find_rela_by_dest(file->rodata, text_rela->addend);
+ rodata_rela = find_rela_by_dest(file->rodata, text_rela->addend);
+ if (!rodata_rela)
+ continue;
+
+ return rodata_rela;
}

return NULL;
--
2.14.3
\
 
 \ /
  Last update: 2018-02-28 03:21    [W:0.087 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site