* [PATCH] complete e390f9a port for v4.9.106
@ 2018-06-09 11:42 Philip Müller
2018-06-09 14:05 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Philip Müller @ 2018-06-09 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: stable, oberon
[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]
objtool ports introduced in v4.9.106 were not totally complete. Therefore
they resulted in issues like:
module: overflow in relocation type 10 val XXXXXXXXXXX
‘usbcore’ likely not compiled with -mcmodel=kernel
module: overflow in relocation type 10 val XXXXXXXXXXX
‘scsi_mod’ likely not compiled with -mcmodel=kernel
Missing part was the complete backport of commit e390f9a.
Original notes by Josh Poimboeuf:
The '__unreachable' and '__func_stack_frame_non_standard' sections are
only used at compile time. They're discarded for vmlinux but they
should also be discarded for modules.
Since this is a recurring pattern, prefix the section names with
".discard.". It's a nice convention and vmlinux.lds.h already discards
such sections.
Also remove the 'a' (allocatable) flag from the __unreachable section
since it doesn't make sense for a discarded section.
Signed-off-by: Philip Müller <philm@manjaro.org>
Fixes: d1091c7fa3d5 ("objtool: Improve detection of BUG() and other dead
ends")
Link: https://gitlab.manjaro.org/packages/core/linux49/issues/2
[-- Attachment #2: complete-e390f9a-port.patch --]
[-- Type: text/x-patch, Size: 970 bytes --]
diff -Npur linux-4.9.106.orig/arch/x86/kernel/vmlinux.lds.S linux-4.9.106/arch/x86/kernel/vmlinux.lds.S
--- linux-4.9.106.orig/arch/x86/kernel/vmlinux.lds.S 2018-06-09 12:43:04.238314000 +0200
+++ linux-4.9.106/arch/x86/kernel/vmlinux.lds.S 2018-06-09 12:44:39.034361441 +0200
@@ -352,8 +352,6 @@ SECTIONS
DISCARDS
/DISCARD/ : {
*(.eh_frame)
- *(__func_stack_frame_non_standard)
- *(__unreachable)
}
}
diff -Npur linux-4.9.106.orig/include/linux/compiler-gcc.h linux-4.9.106/include/linux/compiler-gcc.h
--- linux-4.9.106.orig/include/linux/compiler-gcc.h 2018-06-09 12:43:05.058337000 +0200
+++ linux-4.9.106/include/linux/compiler-gcc.h 2018-06-09 12:45:35.779367605 +0200
@@ -206,7 +206,7 @@
#ifdef CONFIG_STACK_VALIDATION
#define annotate_unreachable() ({ \
asm("1:\t\n" \
- ".pushsection __unreachable, \"a\"\t\n" \
+ ".pushsection .discard.unreachable\t\n" \
".long 1b\t\n" \
".popsection\t\n"); \
})
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] complete e390f9a port for v4.9.106
2018-06-09 11:42 [PATCH] complete e390f9a port for v4.9.106 Philip Müller
@ 2018-06-09 14:05 ` Greg Kroah-Hartman
2018-06-09 19:35 ` Philip Müller
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2018-06-09 14:05 UTC (permalink / raw)
To: Philip Müller; +Cc: stable, oberon
On Sat, Jun 09, 2018 at 01:42:05PM +0200, Philip Müller wrote:
> objtool ports introduced in v4.9.106 were not totally complete. Therefore
> they resulted in issues like:
>
> module: overflow in relocation type 10 val XXXXXXXXXXX
> ‘usbcore’ likely not compiled with -mcmodel=kernel
> module: overflow in relocation type 10 val XXXXXXXXXXX
> ‘scsi_mod’ likely not compiled with -mcmodel=kernel
What is causing these messages? What arch and .config?
> Missing part was the complete backport of commit e390f9a.
Ah, right, I missed those other parts of this commit, good catch.
>
> Original notes by Josh Poimboeuf:
>
> The '__unreachable' and '__func_stack_frame_non_standard' sections are
> only used at compile time. They're discarded for vmlinux but they
> should also be discarded for modules.
>
> Since this is a recurring pattern, prefix the section names with
> ".discard.". It's a nice convention and vmlinux.lds.h already discards
> such sections.
>
> Also remove the 'a' (allocatable) flag from the __unreachable section
> since it doesn't make sense for a discarded section.
>
> Signed-off-by: Philip Müller <philm@manjaro.org>
> Fixes: d1091c7fa3d5 ("objtool: Improve detection of BUG() and other dead
> ends")
> Link: https://gitlab.manjaro.org/packages/core/linux49/issues/2
> diff -Npur linux-4.9.106.orig/arch/x86/kernel/vmlinux.lds.S linux-4.9.106/arch/x86/kernel/vmlinux.lds.S
> --- linux-4.9.106.orig/arch/x86/kernel/vmlinux.lds.S 2018-06-09 12:43:04.238314000 +0200
> +++ linux-4.9.106/arch/x86/kernel/vmlinux.lds.S 2018-06-09 12:44:39.034361441 +0200
> @@ -352,8 +352,6 @@ SECTIONS
> DISCARDS
> /DISCARD/ : {
> *(.eh_frame)
> - *(__func_stack_frame_non_standard)
> - *(__unreachable)
> }
> }
>
> diff -Npur linux-4.9.106.orig/include/linux/compiler-gcc.h linux-4.9.106/include/linux/compiler-gcc.h
> --- linux-4.9.106.orig/include/linux/compiler-gcc.h 2018-06-09 12:43:05.058337000 +0200
> +++ linux-4.9.106/include/linux/compiler-gcc.h 2018-06-09 12:45:35.779367605 +0200
> @@ -206,7 +206,7 @@
> #ifdef CONFIG_STACK_VALIDATION
> #define annotate_unreachable() ({ \
> asm("1:\t\n" \
> - ".pushsection __unreachable, \"a\"\t\n" \
> + ".pushsection .discard.unreachable\t\n" \
> ".long 1b\t\n" \
> ".popsection\t\n"); \
> })
What about the fix up to scripts/mod/modpost and module-common.lds? Are
they not needed?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] complete e390f9a port for v4.9.106
2018-06-09 14:05 ` Greg Kroah-Hartman
@ 2018-06-09 19:35 ` Philip Müller
2018-06-12 16:16 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Philip Müller @ 2018-06-09 19:35 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: stable, oberon
On 09.06.2018 16:05, Greg Kroah-Hartman wrote:
>
> What about the fix up to scripts/mod/modpost and module-common.lds? Are
> they not needed?
>
> thanks,
>
> greg k-h
>
Hi Greg,
I went thru the whole patch. You already had everything merged, except
those two, I added with my patch.
Best, Philip
---
include/linux/frame.h
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/include/linux/frame.h?h=linux-4.9.y&id=35aee626fa6311c3942fedd50c50f6748922e89f
scripts/mod/modpost.c
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/scripts/mod/modpost.c?h=linux-4.9.y&id=35aee626fa6311c3942fedd50c50f6748922e89f
scripts/module-commons.lds
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/scripts/module-common.lds?h=linux-4.9.y&id=35aee626fa6311c3942fedd50c50f6748922e89f
tools/objtool/builtin-check.c
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/tools/objtool/builtin-check.c?h=linux-4.9.y&id=35aee626fa6311c3942fedd50c50f6748922e89f
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/tools/objtool/builtin-check.c?h=linux-4.9.y&id=24ac7a44f7201fdecb2b4068de1ac808f265ede4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] complete e390f9a port for v4.9.106
2018-06-09 19:35 ` Philip Müller
@ 2018-06-12 16:16 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2018-06-12 16:16 UTC (permalink / raw)
To: Philip Müller; +Cc: stable, oberon
On Sat, Jun 09, 2018 at 09:35:27PM +0200, Philip M�ller wrote:
> On 09.06.2018 16:05, Greg Kroah-Hartman wrote:
> >
> > What about the fix up to scripts/mod/modpost and module-common.lds? Are
> > they not needed?
> >
> > thanks,
> >
> > greg k-h
> >
>
> Hi Greg,
>
> I went thru the whole patch. You already had everything merged, except
> those two, I added with my patch.
Thanks for the patch, now queued up.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-06-12 16:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-09 11:42 [PATCH] complete e390f9a port for v4.9.106 Philip Müller
2018-06-09 14:05 ` Greg Kroah-Hartman
2018-06-09 19:35 ` Philip Müller
2018-06-12 16:16 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.