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]
Date:	Thu, 18 Aug 2016 08:10:19 +0800
From:	zijun_hu <zijun_hu@...o.com>
To:	Al Viro <viro@...IV.linux.org.uk>
Cc:	Stephen Rothwell <sfr@...b.auug.org.au>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RESEND PATCH 1/1] bitops.h: move out get_count_order[_long]()
 from __KERNEL__ scope

On 2016/8/18 7:59, Al Viro wrote:
> On Thu, Aug 18, 2016 at 07:51:19AM +0800, zijun_hu wrote:
>>> What the hell is anything without __KERNEL__ doing with linux/bitops.h in
>>> the first place?  IOW, why do we have those ifdefs at all?
>>>
>>
>> __KERNEL__ is used to indicate the relevant sections within kernel
>> headers can't be exported to or used by user space
> 
> ITYM "used to be used".  These days it's "everything outside of */uapi/*.h
> can't be exported"...
> 
i conclude one purpose of __KERNEL__ from the following kernel files

scripts/headers_install.sh:
echo "Usage: headers_install.sh OUTDIR SRCDIR [FILES...]"
echo
echo "Prepares kernel header files for use by user space, by removing"
echo "all compiler.h definitions and #includes, removing any"
echo "#ifdef __KERNEL__ sections, and putting __underscores__ around"
echo "asm/inline/volatile keywords."
echo
......
scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed"

Documentation/kbuild/makefiles.txt:
The kernel includes a set of headers that is exported to userspace.
Many headers can be exported as-is but other headers require a
minimal pre-processing before they are ready for user-space.
The pre-processing does:
- drop kernel-specific annotations
- drop include of compiler.h
- drop all sections that are kernel internal (guarded by ifdef __KERNEL__)

scripts/Makefile.headersinst:
# ==========================================================================
# Installing headers
#
# header-y  - list files to be installed. They are preprocessed
#             to remove __KERNEL__ section of the file
# genhdr-y  - Same as header-y but in a generated/ directory
#
# ==========================================================================



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ