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-next>] [day] [month] [year] [list]
Message-Id: <20230705140117.795478-1-arnd@kernel.org>
Date:   Wed,  5 Jul 2023 16:01:08 +0200
From:   Arnd Bergmann <arnd@...nel.org>
To:     Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
        David Sterba <dsterba@...e.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Johannes Thumshirn <johannes.thumshirn@....com>,
        Anand Jain <anand.jain@...cle.com>,
        Filipe Manana <fdmanana@...e.com>, Qu Wenruo <wqu@...e.com>,
        linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] btrfs: avoid Wmaybe-uninitialized warnings

From: Arnd Bergmann <arnd@...db.de>

The -Wmaybe-uninitialized warning option in gcc produces tons of false
positive warnings when KASAN is enabled, as that turns off some required
optimizations.

Rework the makefile to only enable the warning in btrfs when KASAN is
disabled, as it was before commit 78a5255ffb6a1 ("Stop the ad-hoc games
with -Wno-maybe-initialized") turned it off globally.

Fixes: 1ec49744ba83f ("btrfs: turn on -Wmaybe-uninitialized")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 fs/btrfs/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
index 90d53209755bf..a4927bf2ce7ee 100644
--- a/fs/btrfs/Makefile
+++ b/fs/btrfs/Makefile
@@ -11,8 +11,12 @@ condflags := \
 	$(call cc-option, -Wunused-but-set-variable)		\
 	$(call cc-option, -Wunused-const-variable)		\
 	$(call cc-option, -Wpacked-not-aligned)			\
-	$(call cc-option, -Wstringop-truncation)		\
-	$(call cc-option, -Wmaybe-uninitialized)
+	$(call cc-option, -Wstringop-truncation)
+
+ifndef CONFIG_KASAN
+conflags += $(call cc-option, -Wmaybe-uninitialized)
+endif
+
 subdir-ccflags-y += $(condflags)
 # The following turn off the warnings enabled by -Wextra
 subdir-ccflags-y += -Wno-missing-field-initializers
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ