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: <YqIJ1iimwIlFDa4n@dev-arch.thelio-3990X>
Date:   Thu, 9 Jun 2022 07:55:18 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     Kees Cook <keescook@...omium.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        David Howells <dhowells@...hat.com>,
        Sven Schnelle <svens@...ux.ibm.com>,
        Heiko Carstens <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Alexander Gordeev <agordeev@...ux.ibm.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] s390: disable -Warray-bounds

On Wed, Jun 08, 2022 at 04:59:29PM -0700, Linus Torvalds wrote:

Just one small drive by comment in case this ends up going in in one
form or another.

>  Makefile                         |  4 ++++
>  arch/s390/Makefile               | 10 +---------
>  drivers/gpu/drm/imx/ipuv3-crtc.c |  2 +-
>  init/Kconfig                     |  5 +++++
>  4 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index c43d825a3c4c..b2e93c1a8021 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -788,6 +788,7 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG)      := -fstack-protector-strong
>  KBUILD_CFLAGS += $(stackp-flags-y)
>  
>  KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror
> +KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds
>  KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
>  
>  ifdef CONFIG_CC_IS_CLANG
> @@ -805,6 +806,9 @@ endif
>  KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
>  KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
>  
> +# These result in bogus false positives
> +KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer)
> +
>  ifdef CONFIG_FRAME_POINTER
>  KBUILD_CFLAGS	+= -fno-omit-frame-pointer -fno-optimize-sibling-calls
>  else
> diff --git a/arch/s390/Makefile b/arch/s390/Makefile
> index d73611b35164..e1abb0d03824 100644
> --- a/arch/s390/Makefile
> +++ b/arch/s390/Makefile
> @@ -32,15 +32,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
>  KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
>  KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
>  KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
> -
> -ifdef CONFIG_CC_IS_GCC
> -	ifeq ($(call cc-ifversion, -ge, 1200, y), y)
> -		ifeq ($(call cc-ifversion, -lt, 1300, y), y)
> -			KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds)
> -			KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, array-bounds)
> -		endif
> -	endif
> -endif
> +KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CC_NO_ARRAY_BOUNDS),-Wno-array-bounds)

I think this should be $(CONFIG_CC_NO_ARRAY_BOUNDS)?

>  
>  UTS_MACHINE	:= s390x
>  STACK_SIZE	:= $(if $(CONFIG_KASAN),65536,16384)
> diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
> index 9c8829f945b2..f7863d6dea80 100644
> --- a/drivers/gpu/drm/imx/ipuv3-crtc.c
> +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
> @@ -69,7 +69,7 @@ static void ipu_crtc_disable_planes(struct ipu_crtc *ipu_crtc,
>  	drm_atomic_crtc_state_for_each_plane(plane, old_crtc_state) {
>  		if (plane == &ipu_crtc->plane[0]->base)
>  			disable_full = true;
> -		if (&ipu_crtc->plane[1] && plane == &ipu_crtc->plane[1]->base)
> +		if (ipu_crtc->plane[1] && plane == &ipu_crtc->plane[1]->base)
>  			disable_partial = true;
>  	}
>  
> diff --git a/init/Kconfig b/init/Kconfig
> index c984afc489de..ccb1302d6edd 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -885,6 +885,11 @@ config CC_IMPLICIT_FALLTHROUGH
>  	default "-Wimplicit-fallthrough=5" if CC_IS_GCC && $(cc-option,-Wimplicit-fallthrough=5)
>  	default "-Wimplicit-fallthrough" if CC_IS_CLANG && $(cc-option,-Wunreachable-code-fallthrough)
>  
> +config CC_NO_ARRAY_BOUNDS
> +	bool
> +	depends on CC_IS_GCC
> +	default y if GCC_VERSION >= 120000 && GCC_VERSION < 130000
> +
>  #
>  # For architectures that know their GCC __int128 support is sound
>  #

Cheers,
Nathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ