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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 7 Dec 2017 07:16:24 +0100
From:   Ingo Molnar <mingo@...nel.org>
To:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc:     Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Andy Lutomirski <luto@...capital.net>,
        Cyrill Gorcunov <gorcunov@...nvz.org>,
        Borislav Petkov <bp@...e.de>, Andi Kleen <ak@...ux.intel.com>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        stable@...r.kernel.org
Subject: Re: [PATCHv4 1/4] x86/boot/compressed/64: Fix build with GCC < 5


* Kirill A. Shutemov <kirill.shutemov@...ux.intel.com> wrote:

> 0-day reported this build error:
> 
>    arch/x86/boot/compressed/pgtable_64.o: In function `l5_paging_required':
>    pgtable_64.c:(.text+0x22): undefined reference to `__force_order'
> 
> The issue is only with GCC < 5 and when KASLR is disabled. Newer GCC
> works fine.
> 
> __force_order is used by special_insns.h asm code to force instruction
> serialization.

s/is used by special_insns.h asm code
 /is used by the special_insns.h asm code

> It doesn't actually referenced from the code, but GCC < 5 with -fPIE
> would still generate undefined symbol.

s/It doesn't actually referenced from the code
 /It isn't actually referenced from the code

s/would still generate undefined symbol.
 /would still generate an undefined symbol.

> I didn't noticed this before and failed to move __force_order definition
> from pagetable.c (which compiles only with KASLR enabled) to
> pgtable_64.c.
> 
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> Fixes: 10c9a5346f72 ("x86/boot/compressed/64: Detect and handle 5-level paging at boot-time")
> Cc: stable@...r.kernel.org
> ---
>  arch/x86/boot/compressed/pagetable.c  |  3 ---
>  arch/x86/boot/compressed/pgtable_64.c | 11 +++++++++++
>  2 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/boot/compressed/pagetable.c b/arch/x86/boot/compressed/pagetable.c
> index 6bd51de4475c..250826ac216e 100644
> --- a/arch/x86/boot/compressed/pagetable.c
> +++ b/arch/x86/boot/compressed/pagetable.c
> @@ -38,9 +38,6 @@
>  #define __PAGE_OFFSET __PAGE_OFFSET_BASE
>  #include "../../mm/ident_map.c"
>  
> -/* Used by pgtable.h asm code to force instruction serialization. */
> -unsigned long __force_order;
> -
>  /* Used to track our page table allocation area. */
>  struct alloc_pgt_data {
>  	unsigned char *pgt_buf;
> diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c
> index 7bcf03b376da..491fa2d08bca 100644
> --- a/arch/x86/boot/compressed/pgtable_64.c
> +++ b/arch/x86/boot/compressed/pgtable_64.c
> @@ -1,5 +1,16 @@
>  #include <asm/processor.h>
>  
> +/*
> + * __force_order is used by special_insns.h asm code to force instruction
> + * serialization.

s/is used by special_insns.h asm code
 /is used by the special_insns.h asm code

> + *
> + * It doesn't actually referenced from the code, but GCC < 5 with -fPIE
> + * would still generate undefined symbol.

s/It doesn't actually referenced from the code
 /It isn't actually referenced from the code

s/would still generate undefined symbol.
 /would still generate an undefined symbol.

> + *
> + * Let's workaround this by defining the variable.

s/Let's workaround
 /Let's work around

Also, for the title:

s/Fix build with GCC < 5
 /Fix the build with GCC < 5

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ