lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 2 Mar 2021 21:35:56 +0100
From:   Arnd Bergmann <arnd@...nel.org>
To:     Helge Deller <deller@....de>
Cc:     Nick Desaulniers <ndesaulniers@...gle.com>,
        Parisc List <linux-parisc@...r.kernel.org>,
        James Bottomley <James.Bottomley@...senpartnership.com>,
        kbuild-all@...ts.01.org, LKML <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        kernel test robot <lkp@...el.com>,
        John David Anglin <dave.anglin@...l.net>
Subject: Re: hppa64-linux-ld: kernel/sched/core.o(.init.text+0x90): cannot
 reach printk

On Tue, Mar 2, 2021 at 9:28 PM Helge Deller <deller@....de> wrote:
> * Helge Deller <deller@....de>:
> > On 3/2/21 7:07 PM, Nick Desaulniers wrote:
> > > + Arnd
> > >
> > > On Tue, Mar 2, 2021 at 10:03 AM Helge Deller <deller@....de> wrote:
> > > >
> > > >
> From: Helge Deller <deller@....de>
> Date: Tue, 2 Mar 2021 21:07:07 +0100
> Subject: [PATCH] parisc: Enable -mlong-calls gcc option with
>  CONFIG_COMPILE_TEST
>
> The kernel test robot reported multiple linkage problems like this:
>
>     hppa64-linux-ld: init/main.o(.init.text+0x56c): cannot reach printk
>     init/main.o: in function `unknown_bootoption':
>     (.init.text+0x56c): relocation truncated to fit: R_PARISC_PCREL22F against
>         symbol `printk' defined in .text.unlikely section in kernel/printk/printk.o
>
> There are two ways to solve it:
> a) Enable the -mlong-call compiler option (CONFIG_MLONGCALLS),
> b) Add long branch stub support in 64-bit linker.
>
> While b) is the long-term solution, this patch works around the issue by
> automatically enabling the CONFIG_MLONGCALLS option when
> CONFIG_COMPILE_TEST is set, which indicates that a non-production kernel
> (e.g. 0-day kernel) is built.
>
> Signed-off-by: Helge Deller <deller@....de>
> Reported-by: kernel test robot <lkp@...el.com>
> Fixes: 00e35f2b0e8a ("parisc: Enable -mlong-calls gcc option by default when !CONFIG_MODULES")
> Cc: stable@...r.kernel.org # v5.6+
>
> diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
> index 4e53ac46e857..afc3b8d03572 100644
> --- a/arch/parisc/Kconfig
> +++ b/arch/parisc/Kconfig
> @@ -203,9 +203,12 @@ config PREFETCH
>         def_bool y
>         depends on PA8X00 || PA7200
>
> +config PARISC_HUGE_KERNEL
> +       def_bool y if !MODULES || UBSAN || FTRACE || COMPILE_TEST
> +
>  config MLONGCALLS
> -       def_bool y if !MODULES || UBSAN || FTRACE
> -       bool "Enable the -mlong-calls compiler option for big kernels" if MODULES && !UBSAN && !FTRACE
> +       def_bool y if PARISC_HUGE_KERNEL
> +       bool "Enable the -mlong-calls compiler option for big kernels" if !PARISC_HUGE_KERNEL
>         depends on PA8X00
>         help
>           If you configure the kernel to include many drivers built-in instead


Looks good to me, we should probably do something similar on arm with
CONFIG_{ARM,ARM64}_MODULE_PLTS, though that only affects loadable
modules, as the linker would insert its own trampolines during the final
link when branch relocations are out of range.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ