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: <D8S5XFO82X83.356EJDDZP8RZX@fjasle.eu>
Date: Fri, 28 Mar 2025 20:57:01 +0100
From: "Nicolas Schier" <nicolas@...sle.eu>
To: "Khem Raj" <raj.khem@...il.com>, "Thomas Bogendoerfer"
 <tsbogend@...ha.franken.de>, "Masahiro Yamada" <masahiroy@...nel.org>,
 "Kees Cook" <kees@...nel.org>
Cc: <linux-mips@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <stable@...r.kernel.org>
Subject: Re: [PATCH v2] mips: Add '-std=gnu11' to vdso CFLAGS

On Thu Mar 27, 2025 at 04:24 CET, Khem Raj wrote:
> GCC 15 changed the default C standard dialect from gnu17 to gnu23,
> which should not have impacted the kernel because it explicitly requests
> the gnu11 standard in the main Makefile. However, mips/vdso code uses
> its own CFLAGS without a '-std=' value, which break with this dialect
> change because of the kernel's own definitions of bool, false, and true
> conflicting with the C23 reserved keywords.
>
>   include/linux/stddef.h:11:9: error: cannot use keyword 'false' as enumeration constant
>      11 |         false   = 0,
>         |         ^~~~~
>   include/linux/stddef.h:11:9: note: 'false' is a keyword with '-std=c23' onwards
>   include/linux/types.h:35:33: error: 'bool' cannot be defined via 'typedef'
>      35 | typedef _Bool                   bool;
>         |                                 ^~~~
>   include/linux/types.h:35:33: note: 'bool' is a keyword with '-std=c23' onwards
>
> Add '-std=gnu11' to the decompressor and purgatory CFLAGS to eliminate
> these errors and make the C standard version of these areas match the
> rest of the kernel.
>
> Signed-off-by: Khem Raj <raj.khem@...il.com>
> Cc: stable@...r.kernel.org
> ---
> v2: Filter the -std flag from KBUILD_CFLAGS instead of hardcoding
>
>  arch/mips/vdso/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
> index fb4c493aaffa..69d4593f64fe 100644
> --- a/arch/mips/vdso/Makefile
> +++ b/arch/mips/vdso/Makefile
> @@ -27,6 +27,7 @@ endif
>  # offsets.
>  cflags-vdso := $(ccflags-vdso) \
>  	$(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
> +	$(filter -std=%,$(KBUILD_CFLAGS)) \
>  	-O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
>  	-mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \
>  	-fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \

Thanks.

Reviewed-by: Nicolas Schier <nicolas@...sle.eu>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ