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] [day] [month] [year] [list]
Message-ID: <20250701.daeghaimaL0s@digikod.net>
Date: Tue, 1 Jul 2025 11:07:06 +0200
From: Mickaël Salaün <mic@...ikod.net>
To: Brahmajit Das <listout@...tout.xyz>, kees@...nel.org
Cc: linux-kernel@...r.kernel.org, gnoack3000@...il.com
Subject: Re: [RFC PATCH] samples/check-exec: Fix building on musl libc

On Tue, Jul 01, 2025 at 01:53:53AM +0530, Brahmajit Das wrote:
> Building with make allyesconfig on musl results in the following
> 
> In file included from samples/check-exec/inc.c:23:
> /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
>    88 | struct prctl_mm_map {
>       |        ^~~~~~~~~~~~
> In file included from samples/check-exec/inc.c:17:
> 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>

Thanks!

Reviewed-by: Mickaël Salaün <mic@...ikod.net>

Kees, feel free to take it in your tree.  FYI, for the equivalent
changes in Landlock, I moved down the if/include/endif block to ease
sorting of include lines.

> ---
>  samples/check-exec/inc.c      | 2 ++
>  samples/check-exec/set-exec.c | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/samples/check-exec/inc.c b/samples/check-exec/inc.c
> index 7f6ef06a2f06..775ae8613782 100644
> --- a/samples/check-exec/inc.c
> +++ b/samples/check-exec/inc.c
> @@ -14,7 +14,9 @@
>  #define _GNU_SOURCE
>  #include <errno.h>
>  #include <linux/fcntl.h>
> +#if defined(__GLIBC__)
>  #include <linux/prctl.h>
> +#endif
>  #include <linux/securebits.h>
>  #include <stdbool.h>
>  #include <stdio.h>
> diff --git a/samples/check-exec/set-exec.c b/samples/check-exec/set-exec.c
> index ba86a60a20dd..a75b8c6e6b11 100644
> --- a/samples/check-exec/set-exec.c
> +++ b/samples/check-exec/set-exec.c
> @@ -9,7 +9,9 @@
>  #define _GNU_SOURCE
>  #define __SANE_USERSPACE_TYPES__
>  #include <errno.h>
> +#if defined(__GLIBC__)
>  #include <linux/prctl.h>
> +#endif
>  #include <linux/securebits.h>
>  #include <stdbool.h>
>  #include <stdio.h>
> -- 
> 2.50.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ