[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrVxa9U9GMOnPZ5cAnPJvtCqjia1J1e5YBET6deAPKU82g@mail.gmail.com>
Date: Thu, 18 Jun 2015 11:57:56 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Arnd Bergmann <arnd@...db.de>
Cc: Michael Kerrisk-manpages <mtk.manpages@...il.com>,
Andy Lutomirski <luto@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linux API <linux-api@...r.kernel.org>,
David Woodhouse <dwmw2@...radead.org>
Subject: Re: UAPI headers including non-UAPI headers by accident?
On Thu, Jun 18, 2015 at 12:58 AM, Arnd Bergmann <arnd@...db.de> wrote:
> On Thursday 18 June 2015 09:52:36 Michael Kerrisk wrote:
>> [CC += David]
>>
>> On 2 June 2015 at 18:36, Andy Lutomirski <luto@...nel.org> wrote:
>> > include/uapi/linux/signal.h starts with:
>> >
>> > #ifndef _UAPI_LINUX_SIGNAL_H
>> > #define _UAPI_LINUX_SIGNAL_H
>> >
>> > #include <asm/signal.h>
>> > #include <asm/siginfo.h>
>> >
>> > This causes it to include <asm/signal.h>, which is not the same thing
>> > as <uapi/asm/signal.h>. Changing that will break userspace use of
>> > this header, though, as the uapi/ won't get removed.
>> >
>> > What's the correct fix? This is causing trouble with a UML build for me.
>>
>> Perhaps David has some insight, since he architected the original UAPI split.
>
> The uapi headers are installed without the uapi prefix. This means
> that inside of the kernel, we get
>
>
> linux/signal.h
> -> uapi/linux/signal.h
> -> asm/signal.h
> -> uapi/asm/signal.h
>
> while in the installed headers we just get
>
> linux/signal.h
> -> asm/signal.h
>
> This all looks right to me: user space only sees the exported portions
> under the traditional names, while the kernel sees both the kernel-side
> and user-side definitions from the same path.
>
It seems counterintuitive and error-prone to me that including
<uapi/linux/signal.h> would pull in non-UAPI asm/signal.h declarations
in the kernel but not when used from userspace. It would make it very
easy to break the header such that it's only broken in a userspace
context.
--Andy
--
Andy Lutomirski
AMA Capital Management, LLC
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists