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]
Message-Id: <20250824072448.7387-1-chandna.sahil@gmail.com>
Date: Sun, 24 Aug 2025 12:54:48 +0530
From: Sahil Chandna <chandna.sahil@...il.com>
To: shuah@...nel.org,
	brauner@...nel.org,
	namcao@...utronix.de,
	alexander@...alicyn.com,
	linux-kselftest@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Sahil Chandna <chandna.sahil@...il.com>
Subject: [PATCH] selftests: coredump: Fix compilation issue

Building coredump selftests fails on x86 due to following issues:

1./usr/include/x86_64-linux-gnu/sys/mount.h:35:3: error: expected identifier before numeric constant
   35 |   MS_RDONLY = 1,                /* Mount read-only.  */
      |

<linux/fs.h> pulls in kernel-internal headers that conflict with
   glibc's <sys/mount.h>, causing this error.

2.stackdump_test.c:25:1: note: ‘offsetof’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?

Missing <stddef.h> causes unresolved use of offsetof().

Fix this by:
  - dropping <linux/fs.h> and including <sys/mount.h>
  - including <stddef.h> for offsetof()

Signed-off-by: Sahil Chandna <chandna.sahil@...il.com>
---
 tools/testing/selftests/coredump/stackdump_test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/coredump/stackdump_test.c b/tools/testing/selftests/coredump/stackdump_test.c
index a4ac80bb1003..881565d28fa9 100644
--- a/tools/testing/selftests/coredump/stackdump_test.c
+++ b/tools/testing/selftests/coredump/stackdump_test.c
@@ -6,7 +6,7 @@
 #include <libgen.h>
 #include <limits.h>
 #include <linux/coredump.h>
-#include <linux/fs.h>
+#include <sys/mount.h>
 #include <linux/limits.h>
 #include <pthread.h>
 #include <string.h>
@@ -18,6 +18,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
+#include <stddef.h>
 
 #include "../kselftest_harness.h"
 #include "../filesystems/wrappers.h"
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ