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>] [day] [month] [year] [list]
Date: Sun,  5 May 2024 14:35:23 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Shuah Khan <shuah@...nel.org>
Cc: Beau Belgrave <beaub@...ux.microsoft.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Mark Brown <broonie@...nel.org>,
	Naresh Kamboju <naresh.kamboju@...aro.org>,
	sunliming <sunliming@...inos.cn>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Valentin Obst <kernel@...entinobst.de>,
	linux-kselftest@...r.kernel.org,
	LKML <linux-kernel@...r.kernel.org>,
	llvm@...ts.linux.dev,
	John Hubbard <jhubbard@...dia.com>
Subject: [PATCH] selftests/user_events: silence a clang warning: address of packed member

When building with clang, via:

    make LLVM=1 -C tools/testing/selftest

..clang warns about "taking address of packed member 'write_index' ".
This is not particularly helpful, because the test code really wants to
write to exactly this location, and if it ends up being unaligned, then
the test won't work (and may segfault, depending on the CPU type).

If that ever comes up, it will be obvious and can be fixed. But all it's
doing now is prevent a clean clang build, so disable the warning.

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

diff --git a/tools/testing/selftests/user_events/Makefile b/tools/testing/selftests/user_events/Makefile
index 10fcd0066203..617e94344711 100644
--- a/tools/testing/selftests/user_events/Makefile
+++ b/tools/testing/selftests/user_events/Makefile
@@ -1,5 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES)
+
+ifneq ($(LLVM),)
+    CFLAGS += -Wno-address-of-packed-member
+endif
+
 LDLIBS += -lrt -lpthread -lm
 
 TEST_GEN_PROGS = ftrace_test dyn_test perf_test abi_test

base-commit: f462ae0edd3703edd6f22fe41d336369c38b884b
prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27
-- 
2.45.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ