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]
Message-ID: <20180814221559.GA15888@roeck-us.net>
Date:   Tue, 14 Aug 2018 15:15:59 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-kernel@...r.kernel.org, Rik van Riel <riel@...riel.com>,
        Mike Galbraith <efault@....de>,
        Dave Hansen <dave.hansen@...el.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: Build failures with gcc 4.5 and older

On Tue, Aug 14, 2018 at 02:36:55PM -0700, Andrew Morton wrote:
> On Tue, 14 Aug 2018 10:09:04 -0700 Guenter Roeck <linux@...ck-us.net> wrote:
> 
> > Since commit c1a2f7f0c0645 ("mm: Allocate the mm_cpumask
> > (mm->cpu_bitmap[]) dynamically based on nr_cpu_ids"), building
> > the Linux kernel with gcc version 4.5 and older fails as follows.
> > 
> > In file included from ./include/linux/mm.h:17:0,
> >                  from ./include/linux/pid_namespace.h:7,
> > 		 from ./include/linux/ptrace.h:10,
> > 		 from arch/openrisc/kernel/asm-offsets.c:32:
> > ./include/linux/mm_types.h:497:16: error: flexible array member in otherwise empty struct
 
> Confused.  Why does it think that the mm_struct is "otherwise empty"?
> 

The problem isn't really that the structure is otherwise empty.
Some digging reveals that the error message is wrong; gcc should
instead complain about having no _named_ structure element before
the flexible array member.

> This shuts it up:
> 
> --- a/include/linux/mm_types.h~a
> +++ a/include/linux/mm_types.h
> @@ -490,6 +490,7 @@ struct mm_struct {
>  #endif
>  	} __randomize_layout;
>  
> +	int wibble;
>  	/*
>  	 * The mm_cpumask needs to be at the end of mm_struct, because it
>  	 * is dynamically sized based on nr_cpu_ids.
> 

Unfortunately, that only triggers secondary errors.
Seen with both gcc 4.4 and 4.5.

mm/init-mm.c:29: error: unknown field ‘mm_rb’ specified in initializer
mm/init-mm.c:29: warning: missing braces around initializer
mm/init-mm.c:29: warning: (near initialization for ‘init_mm.<anonymous>’)
mm/init-mm.c:29: error: incompatible types when initializing type ‘struct
vm_area_struct *’ using type ‘struct rb_root’
mm/init-mm.c:30: error: unknown field ‘pgd’ specified in initializer

and many more similar errors.

Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ