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, 1 Jun 2023 18:33:53 -0700
From:   John Hubbard <jhubbard@...dia.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
CC:     David Hildenbrand <david@...hat.com>, Peter Xu <peterx@...hat.com>,
        "Shuah Khan" <shuah@...nel.org>,
        Nathan Chancellor <nathan@...nel.org>, <linux-mm@...ck.org>,
        <linux-kselftest@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        John Hubbard <jhubbard@...dia.com>
Subject: [PATCH 07/12] selftests/mm: set -Wno-format-security to avoid uffd build warnings

The uffd_test_start() is perhaps a little too elaborate about how it
dispatches tests, leading to a clang warning that looks roughly like
this:

"uffd-unit-tests.c:1198:20: warning: format string is not a string literal
(potentially insecure) [-Wformat-security] ...note: treat the string as
an argument to avoid this.
    uffd_test_start(test_name);
"

However, it doesn't seem worth it to rewrite the way uffd_test_start()
works, given that these tests are already deeply unsafe to begin with.

Fix this by just disabling the compiler warning, but only for
uffd-unit-tests.

Signed-off-by: John Hubbard <jhubbard@...dia.com>
---
 tools/testing/selftests/mm/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
index 23af4633f0f4..473bf1811552 100644
--- a/tools/testing/selftests/mm/Makefile
+++ b/tools/testing/selftests/mm/Makefile
@@ -170,6 +170,8 @@ $(OUTPUT)/ksm_tests: LDLIBS += -lnuma
 
 $(OUTPUT)/migration: LDLIBS += -lnuma
 
+$(OUTPUT)/uffd-unit-tests: CFLAGS += -Wno-format-security
+
 local_config.mk local_config.h: check_config.sh
 	/bin/sh ./check_config.sh $(CC)
 
-- 
2.40.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ