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]
Message-ID: <CAMj1kXEBT=y+_4JHe=i-5c59YXg6MReK2cHxf0ufWYQUq5GsJQ@mail.gmail.com>
Date:   Mon, 30 May 2022 13:01:03 +0200
From:   Ard Biesheuvel <ardb@...nel.org>
To:     kernel test robot <lkp@...el.com>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
        Linus Walleij <linus.walleij@...aro.org>
Subject: Re: <instantiation>:2:2: error: out of range pc-relative fixup value

(cc Nathan and Nick)

On Sun, 29 May 2022 at 02:22, kernel test robot <lkp@...el.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   9d004b2f4fea97cde123e7f1939b80e77bf2e695
> commit: 508074607c7b95b24f0adf633fdf606761bb7824 ARM: 9195/1: entry: avoid explicit literal loads
> date:   9 days ago
> config: arm-randconfig-r005-20220529 (https://download.01.org/0day-ci/archive/20220529/202205290805.1vZLAr36-lkp@intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0fbe3f3f486e01448121f7931a4ca29fac1504ab)
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # install arm cross compiling tool for clang build
>         # apt-get install binutils-arm-linux-gnueabi
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=508074607c7b95b24f0adf633fdf606761bb7824
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 508074607c7b95b24f0adf633fdf606761bb7824
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@...el.com>
>
> All errors (new ones prefixed by >>):
>
> >> <instantiation>:2:2: error: out of range pc-relative fixup value
>     ldr tsk, =__current
>     ^
>

This log snippet is a bit terse. I managed to narrow this down to
arch/arm/kernel/entry-common.S but having a bit more context from the
build log would be useful here.

The commit in question reorganizes some variable loads from asm code
by switching to the ldr_va macro, which avoids literals in most cases,
but not when CONFIG_COMPILE_TEST=y as is the case here. (This is due
to the fact that allyesconfig produces a vmlinux image whose size
exceeds the 256 MB range of ARM group relocations used by ldr_va, and
so group relocations are not used in this case)

This means that those ldr_va macros evaluate to literal loads such as
the 'ldr tsk, =__current' reported above, and the literal pool entry
carrying the address of __current can no longer be emitted close
enough to the LDR instruction itself, due to the way those literal
loads have been slightly reshuffled by that commit.

This is easily fixed by putting a .ltorg directive in the appropriate
location (I'll send out the patch right away) but it does beg the
question whether or not we need to keep allyesconfig building, given
that it cannot actually boot on a real (or emulated) system.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ