Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240906164249.GO32249@brightrain.aerifal.cx>
Date: Fri, 6 Sep 2024 12:42:49 -0400
From: Rich Felker <dalias@...c.org>
To: jane400 <jane400@...tmarketos.org>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH] sys/prctl.h: use linux uapi header

On Fri, Sep 06, 2024 at 04:12:23PM +0200, jane400 wrote:
> On 06.09.24 14:45, Rich Felker wrote:
> > On Fri, Sep 06, 2024 at 01:49:30PM +0200, jane400 wrote:
> > > The file also includes backports until 2023 for older kernels.
> > > 
> > > There are no exisiting UAPI guards in the kernel for this header
> > > and as complex projects like systemd sometimes use both, it was
> > > easiest to just use the defintions from the kernel directly instead
> > > of copying in them. This way we're never redefining stuff in end-user
> > > applications and get the benefit of using the latest API that is
> > > available on this system.
> > Using both is not a supported usage. This comes up in multiple places
> > other than sys/prctl.h, like lots of network stuff, and the
> > applications doing it just need to be fixed. Generally we do not use
> > uapi headers at all from musl, and offer a working compilation
> > environment without uapi headers installed. This would also be a
> > breaking change if we ever needed to call prctls internally from libc,
> > as then building musl itself would depend on kernel headers.
> 
> Another solution of course is expanding the linux/libc-compat.h a lot and
> use the `#if !__UAPI_DEF_FOO` in musl, as intended by the kernel. I can poke
> at bit at the kernel and bring that forward if you want?

We intentionally don't support having types defined from the kernel
headers because of ways they could potentially disagree. The other
direction, musl defining the __UAPI_* macros to suppress kernel header
definitions, is supported, and should be acceptable to add here if the
kernel honored it. This requires including the libc headers first,
which is already the policy for network headers.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.