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] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.00.0803260913350.6316@localhost.localdomain>
Date:	Wed, 26 Mar 2008 09:16:32 -0400 (EDT)
From:	"Robert P. J. Day" <rpjday@...shcourse.ca>
To:	David Woodhouse <dwmw2@...radead.org>
cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: why so many unexported headers checking __KERNEL__?

On Wed, 26 Mar 2008, David Woodhouse wrote:

> On Wed, 2008-03-26 at 08:53 -0400, Robert P. J. Day wrote:
> > not surprisingly, the only reason i noticed the above was because
> > i hacked together a short script that went looking for all of the
> > above and i was surprised at the number of files it identified.
>
> It's not _that_ surprising. Remember, before headers_install people
> just used to copy _all_ the headers across, and so the only way to
> hide stuff was to wrap entire files in #ifdef __KERNEL__.

ah, i had no idea.  that explains it.

> > p.s. the other case that could be identified is when a header file
> > has its *entire* contents encased in a __KERNEL__ test, (either
> > ifdef or ifndef).  AFAICT, unless that kind of test is
> > partitioning *some* of a header file content from the remainder,
> > there's little value in a __KERNEL__test if the end result is to
> > either:
> >
> >   a) leave the file exactly as is, or
> >   b) reduce it to empty
>
> Right.
>
> If it's entirely #ifndef __KERNEL__ then it's a userspace header. It
> probably doesn't live in the kernel source tree at all.
>
> If it's entirely #ifdef __KERNEL__ then it shouldn't be exported at
> all (although when we do that we sometimes have to deal with
> userspace programs which include it even though it's empty).

well, since i already have the output from my script, i might toss
together some per-directory patches to start removing some of that.
this sounds more like a one-shot thing than adding permanent checking
to the build process.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ