linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quentin Casasnovas <quentin.casasnovas@oracle.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	lkml <linux-kernel@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next <linux-next@vger.kernel.org>
Subject: Re: [PATCH 0/2] Tentative fix for the divide-by-zero on score/paris/..
Date: Wed, 15 Apr 2015 23:19:56 +0200	[thread overview]
Message-ID: <20150415211956.GA6703@chrystal.uk.oracle.com> (raw)
In-Reply-To: <552E6722.1080507@roeck-us.net>

[-- Attachment #1: Type: text/plain, Size: 2004 bytes --]

On Wed, Apr 15, 2015 at 06:26:58AM -0700, Guenter Roeck wrote:
> On 04/15/2015 01:54 AM, Quentin Casasnovas wrote:
> > The following two patches might (hopefully) fix the build breakage on score
> > and some other architectures.  I've checked the new __ex_table checker
> > still works on x86-64 with them (it still detects an entry pointing to
> > .altinstr_rplacement) and they should apply cleanly on top of Rusty's
> > module-next branch.
> >
> > Thanks to Guenter for the bug analysis and sorry again for the breakage.
> >
> > Let me know if this makes things better..
> >
> 
> the crash is fixed, but now I get
> 
> FATAL: The relocation at __ex_table+0x4 references
> section "" which is not executable, IOW
> the kernel will fault if it ever tries to
> jump to it.  Something is seriously wrong
> and should be fixed.
> 
> for parisc:defconfig,
> 
> FATAL: The relocation at __ex_table+0x634 references
> section "__ex_table" which is not executable, IOW
> the kernel will fault if it ever tries to
> jump to it.  Something is seriously wrong
> and should be fixed.
> 
> for score:allnoconfig, and
> 
> FATAL: The relocation at __ex_table+0x8 references
> section "" which is not executable, IOW
> it is not possible for the kernel to fault
> at that address.  Something is seriously wrong
> and should be fixed.
> 
> for mn10300:defconfig.
> 
> While I agree that those should get fixed (if they are real problems,
> especially the ones for parisc and mn10300), I don't think it is
> a good idea to fail the build because of it.
> 
> Note that I did find the problem in the score build; that was a real bug.
> I don't know what may be wrong with the others.
> 

The attached patch fixes the build failures on parisc and mn10300 on my
defconfig build and should apply cleanly on top of the previous two.

I'm not able to download the score cross toolchain for the moment but will
do tomorrow. Guenter, may I ask if there were any other problems than the
one you fixed in string.S there?

Quentin

[-- Attachment #2: 0001-modpost-do-not-try-to-match-the-SHT_NUL-section.patch --]
[-- Type: text/x-diff, Size: 1568 bytes --]

>From 2e9abac9cbde18af48951c54d52c9c515f9883a7 Mon Sep 17 00:00:00 2001
From: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Date: Wed, 15 Apr 2015 22:39:50 +0200
Subject: [PATCH] modpost: do not try to match the SHT_NUL section.

Trying to match the SHT_NUL section isn't useful and causes build failures
on parisc and mn10300 since the addition of section strict white-listing
and __ex_table sanitizing.

Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
CC: Rusty Russell <rusty@rustcorp.com.au>
Fixes: 050e57fd5936 ("modpost: add strict white-listing when referencing....")
Fixes: 52dc0595d540 ("modpost: handle relocations mismatch in __ex_table.")
---
 scripts/mod/modpost.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index fd94977..45e4027 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1064,6 +1064,15 @@ static const struct sectioncheck *section_mismatch(
 	int elems = sizeof(sectioncheck) / sizeof(struct sectioncheck);
 	const struct sectioncheck *check = &sectioncheck[0];
 
+	/*
+	 * The target section could be the SHT_NUL section when we're
+	 * handling relocations to un-resolved symbols, trying to match it
+	 * doesn't make much sense and causes build failures on parisc and
+	 * mn10300 architectures.
+	 */
+	if (*tosec == '\0')
+		return NULL;
+
 	for (i = 0; i < elems; i++) {
 		if (match(fromsec, check->fromsec)) {
 			if (check->bad_tosec[0] && match(tosec, check->bad_tosec))
-- 
2.0.5


  parent reply	other threads:[~2015-04-15 21:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14  8:42 linux-next: Tree for Apr 14 Stephen Rothwell
2015-04-14 16:11 ` linux-next: Tree for Apr 14 (crash due to modpost patch) Guenter Roeck
2015-04-14 16:36   ` Quentin Casasnovas
2015-04-14 16:50     ` Guenter Roeck
2015-04-15  8:54       ` [PATCH 0/2] Tentative fix for the divide-by-zero on score/paris/ Quentin Casasnovas
2015-04-15  8:54         ` [PATCH 1/2] modpost: fix inverted logic in is_extable_fault_address() Quentin Casasnovas
2015-04-15  8:54         ` [PATCH 2/2] modpost: fix extable entry size calculation Quentin Casasnovas
2015-04-15 13:26         ` [PATCH 0/2] Tentative fix for the divide-by-zero on score/paris/ Guenter Roeck
2015-04-15 13:46           ` Quentin Casasnovas
2015-04-15 15:31             ` Guenter Roeck
2015-04-15 16:49               ` Quentin Casasnovas
2015-04-15 21:19           ` Quentin Casasnovas [this message]
2015-04-15 21:32             ` Guenter Roeck
2015-04-16  1:43             ` Guenter Roeck
2015-04-16  3:49               ` Rusty Russell
2015-04-16  8:21               ` Quentin Casasnovas
2015-04-16 12:47                 ` Guenter Roeck
2015-04-16 13:58                   ` Quentin Casasnovas
2015-04-18  5:52                   ` Guenter Roeck
2015-04-19 11:47                     ` Quentin Casasnovas

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=20150415211956.GA6703@chrystal.uk.oracle.com \
    --to=quentin.casasnovas@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=rusty@rustcorp.com.au \
    --cc=sfr@canb.auug.org.au \
    /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).