[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201203211509.27977.l.lunak@suse.cz>
Date: Wed, 21 Mar 2012 15:09:27 +0100
From: Lubos Lunak <l.lunak@...e.cz>
To: Arnd Bergmann <arnd@...db.de>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] do not export kernel's NULL #define to userspace
On Wednesday 21 of March 2012, Arnd Bergmann wrote:
> 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@...e.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?
I have checked that the kernel builds with this change, and I have checked
that the whole of LibreOffice compiles after the change. I'm not sure what
you mean exactly, are you asking me to manually inspect everything under
include/linux for NULL usage?
> 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.
I see. How about the attached patch then?
--
Lubos Lunak
l.lunak@...e.cz
View attachment "0001-do-not-export-kernel-s-NULL-define-to-userspace.patch" of type "text/x-diff" (1421 bytes)
Powered by blists - more mailing lists