* UAPI headers including non-UAPI headers by accident?
@ 2015-06-02 16:36 Andy Lutomirski
[not found] ` <CALCETrVaWJVDFydhXv320iCuFhTMi9txx+MpzsA_Q7yeZxMDSQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Andy Lutomirski @ 2015-06-02 16:36 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux API
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.
Thanks,
Andy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UAPI headers including non-UAPI headers by accident?
[not found] ` <CALCETrVaWJVDFydhXv320iCuFhTMi9txx+MpzsA_Q7yeZxMDSQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-06-18 7:52 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkjLmBUayYjVOr6Stcbmcn=ENb3Uyt0dkFQCmn-Lxdn0xw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-06-18 7:52 UTC (permalink / raw)
To: Andy Lutomirski
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux API,
David Woodhouse
[CC += David]
On 2 June 2015 at 18:36, Andy Lutomirski <luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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.
Cheers,
Michael
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UAPI headers including non-UAPI headers by accident?
[not found] ` <CAKgNAkjLmBUayYjVOr6Stcbmcn=ENb3Uyt0dkFQCmn-Lxdn0xw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-06-18 7:58 ` Arnd Bergmann
2015-06-18 18:57 ` Andy Lutomirski
0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2015-06-18 7:58 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
Cc: Andy Lutomirski,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux API,
David Woodhouse
On Thursday 18 June 2015 09:52:36 Michael Kerrisk wrote:
> [CC += David]
>
> On 2 June 2015 at 18:36, Andy Lutomirski <luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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.
Arnd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UAPI headers including non-UAPI headers by accident?
2015-06-18 7:58 ` Arnd Bergmann
@ 2015-06-18 18:57 ` Andy Lutomirski
[not found] ` <CALCETrVxa9U9GMOnPZ5cAnPJvtCqjia1J1e5YBET6deAPKU82g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Andy Lutomirski @ 2015-06-18 18:57 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Michael Kerrisk-manpages, Andy Lutomirski,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux API,
David Woodhouse
On Thu, Jun 18, 2015 at 12:58 AM, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
> On Thursday 18 June 2015 09:52:36 Michael Kerrisk wrote:
>> [CC += David]
>>
>> On 2 June 2015 at 18:36, Andy Lutomirski <luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UAPI headers including non-UAPI headers by accident?
[not found] ` <CALCETrVxa9U9GMOnPZ5cAnPJvtCqjia1J1e5YBET6deAPKU82g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-06-23 20:44 ` Arnd Bergmann
2015-06-23 21:20 ` Andy Lutomirski
0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2015-06-23 20:44 UTC (permalink / raw)
To: Andy Lutomirski
Cc: Michael Kerrisk-manpages, Andy Lutomirski,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux API,
David Woodhouse
On Thursday 18 June 2015 11:57:56 Andy Lutomirski wrote:
> On Thu, Jun 18, 2015 at 12:58 AM, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
> > On Thursday 18 June 2015 09:52:36 Michael Kerrisk wrote:
> >> [CC += David]
> >>
> >> On 2 June 2015 at 18:36, Andy Lutomirski <luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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.
>
It's an artifact of how the files were originally generated, as the UAPI
headers used to be part of the normal headers, with #ifdef __KERNEL__ around
the parts that are not in include/uapi now.
For some reason, we now have device drivers including the uapi headers
directly, which was probably done as an accident. Maybe we can just
change them all back to use the normal header file names and add a
checkpatch warning in case someone else tries to use the uapi headers
directly?
Arnd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UAPI headers including non-UAPI headers by accident?
2015-06-23 20:44 ` Arnd Bergmann
@ 2015-06-23 21:20 ` Andy Lutomirski
0 siblings, 0 replies; 6+ messages in thread
From: Andy Lutomirski @ 2015-06-23 21:20 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Michael Kerrisk-manpages, Andy Lutomirski,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux API,
David Woodhouse
On Tue, Jun 23, 2015 at 1:44 PM, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
> On Thursday 18 June 2015 11:57:56 Andy Lutomirski wrote:
>> On Thu, Jun 18, 2015 at 12:58 AM, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
>> > On Thursday 18 June 2015 09:52:36 Michael Kerrisk wrote:
>> >> [CC += David]
>> >>
>> >> On 2 June 2015 at 18:36, Andy Lutomirski <luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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.
>>
>
> It's an artifact of how the files were originally generated, as the UAPI
> headers used to be part of the normal headers, with #ifdef __KERNEL__ around
> the parts that are not in include/uapi now.
>
> For some reason, we now have device drivers including the uapi headers
> directly, which was probably done as an accident. Maybe we can just
> change them all back to use the normal header file names and add a
> checkpatch warning in case someone else tries to use the uapi headers
> directly?
I don't really mind when a driver includes a UAPI header. IMO the
problematic case is when a UAPI header includes a non-UAPI header.
--Andy
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-06-23 21:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-02 16:36 UAPI headers including non-UAPI headers by accident? Andy Lutomirski
[not found] ` <CALCETrVaWJVDFydhXv320iCuFhTMi9txx+MpzsA_Q7yeZxMDSQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-18 7:52 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkjLmBUayYjVOr6Stcbmcn=ENb3Uyt0dkFQCmn-Lxdn0xw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-18 7:58 ` Arnd Bergmann
2015-06-18 18:57 ` Andy Lutomirski
[not found] ` <CALCETrVxa9U9GMOnPZ5cAnPJvtCqjia1J1e5YBET6deAPKU82g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-23 20:44 ` Arnd Bergmann
2015-06-23 21:20 ` Andy Lutomirski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).