Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120906030406.GY27715@brightrain.aerifal.cx>
Date: Wed, 5 Sep 2012 23:04:06 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: capset() capget() syscalls

On Wed, Sep 05, 2012 at 06:01:11PM +0100, Justin Cormack wrote:
> On Wed, Sep 5, 2012 at 3:24 PM, Rich Felker <dalias@...ifal.cx> wrote:
> 
> > There are a lot of direct-kernel-interface-usage situations that
> > require pulling in the associated kernel headers, such as fb.h, kb.h,
> > etc. One issue is that the kernel headers presumably lack prototypes
> > for the functions, but the most portable way to do what you're doing
> > is probably going to be:
> >
> > #include <linux/capabilities.h>
> > #include <sys/syscall.h>
> > ...
> > syscall(SYS_capset, x, y);
> >
> > At least this will work on every Linux libc I know of, and it's
> > hard for them to break it.
> >
> > If you really want to see the header in musl, I'm not opposed to
> > further consideration of the matter, but right now I don't think
> > adding it promotes portable software; rather it seems to promote
> > writing software that works on musl and breaks on glibc.
> 
> It is an unclear situation. Glibc seems inconsistent.
> 
> Personally I think Musl should provide the kernel structures and
> syscalls for everything that is not deprecated.

In principle, I agree with you.

My impression was that the kernel developers intend for this API to be
deprecated for use by applications, and the only reason they haven't
replaced it with a proper kernelspace API is that they assume you'll
be using libcap which wraps/hides the ugliness (and replaces it with
something else that's just ugly in different ways...).

As such, it's sort of a borderline case. Do we really want to be
promoting this API for use by applications?

> I was looking at providing patches for a bunch of missing syscalls
> (which are in glibc).

OK, maybe I should clean up the source tree in preparation for this.
My intent is that src/linux/*.c should be purely syscall wrappers for
non-POSIX syscalls provided by Linux. Right now src/linux also
contains other misc junk, and some of the syscall wrappers are in
src/misc or perhaps other locations..

> I agree with Linus, provide all the headers in libc. I tried to write
> some code to include all syscalls and constants needed for them, and
> as far as I can see it is impossible with glibc due to conflicts. If
> anyone has a set of includes that works let me know....

Can you explain what you mean here?

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.