mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable <stable@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: objtool warnings on 4.14-stable/gcc-7.3.0
Date: Tue, 27 Feb 2018 20:20:40 -0600	[thread overview]
Message-ID: <20180228022040.z5jbv7l2fdbkb3ti@treble> (raw)
In-Reply-To: <20180214224525.esxiqt7yjjjpzyz4@treble>

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

  parent reply	other threads:[~2018-02-28  2:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 15:11 Arnd Bergmann
2018-02-14 22:24 ` Josh Poimboeuf
2018-02-14 22:45   ` Josh Poimboeuf
2018-02-15 14:04     ` Greg KH
2018-02-15 15:01     ` Arnd Bergmann
2018-02-15 15:25       ` Josh Poimboeuf
2018-02-15 15:59         ` Arnd Bergmann
2018-02-15 18:06           ` Kees Cook
2018-02-16  3:41             ` Kees Cook
2018-02-16 15:11               ` Arnd Bergmann
2018-02-28  2:20     ` Josh Poimboeuf [this message]
2018-02-28 11:26       ` Arnd Bergmann
2018-02-15 14:03   ` Greg KH

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=20180228022040.z5jbv7l2fdbkb3ti@treble \
    --to=jpoimboe@redhat.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=stable@vger.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

all inboxes | Powered by JetHome®