The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Lubos Lunak <l.lunak@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] do not export kernel's NULL #define to userspace
Date: Wed, 21 Mar 2012 13:32:05 +0000	[thread overview]
Message-ID: <201203211332.06018.arnd@arndb.de> (raw)
In-Reply-To: <201203211408.25040.l.lunak@suse.cz>

On Wednesday 21 March 2012, Lubos Lunak wrote:
> GCC's NULL is actually __null, which allows detecting some questionable
> NULL usage and warn about it. Moreover each platform/compiler should have
> its own stddef.h anyway (which is different from linux/stddef.h).
> So there's no good reason to leak kernel's NULL to userspace and
> override what the compiler provides.
> 
> Signed-off-by: Luboš Luňák <l.lunak@suse.cz>

Yes, this looks like a bug, but I'm not sure that the solution is
sufficient. Have you checked the other exported header files
for whether they use NULL after including linux/stddef.h?

If so, we might have to replace it with a __KERNEL_NULL constant
or something, like we do for the stuff in linux/types.h, so we
don't accidentally break user applications that rely on the
header files to be self-contained. 

I think there is at least a NULL usage in linux/wireless.h and some
netfilter headers.

	Arnd

  reply	other threads:[~2012-03-21 13:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21 13:08 [PATCH] do not export kernel's NULL #define to userspace Lubos Lunak
2012-03-21 13:32 ` Arnd Bergmann [this message]
2012-03-21 14:09   ` Lubos Lunak
2012-03-21 14:17     ` Arnd Bergmann
2012-03-21 18:37       ` Lubos Lunak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201203211332.06018.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=l.lunak@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox