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: <20250630203248.16273-1-listout@listout.xyz>
Date: Tue,  1 Jul 2025 02:02:48 +0530
From: Brahmajit Das <listout@...tout.xyz>
To: linux-security-module@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: mic@...ikod.net,
	gnoack@...gle.com,
	mic@...ux.microsoft.com,
	jamorris@...ux.microsoft.com
Subject: [RFC PATCH] samples/landlock: Fix building on musl libc

Building with make allyesconfig on musl results in the following

In file included from samples/landlock/sandboxer.c:22:
/usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
   88 | struct prctl_mm_map {
      |        ^~~~~~~~~~~~
In file included from samples/landlock/sandboxer.c:16:
usr/include/linux/prctl.h:134:8: note: originally defined here
  134 | struct prctl_mm_map {
      |        ^~~~~~~~~~~~

This is mainly due to differnece in the sys/prctl.h between glibC and
musl. The struct prctl_mm_map is defined in sys/prctl.h in musl.

Signed-off-by: Brahmajit Das <listout@...tout.xyz>
---
 samples/landlock/sandboxer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/samples/landlock/sandboxer.c b/samples/landlock/sandboxer.c
index 4e2854c6f9a3..3cc990618f5b 100644
--- a/samples/landlock/sandboxer.c
+++ b/samples/landlock/sandboxer.c
@@ -13,7 +13,9 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <linux/landlock.h>
+#if defined(__GLIBC__)
 #include <linux/prctl.h>
+#endif
 #include <linux/socket.h>
 #include <stddef.h>
 #include <stdio.h>
-- 
2.50.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ