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: <CA+55aFwmZiWfqEF3-Lb_d1jHZQf2Od+oGQ_hfe0CYu8fBTU8nw@mail.gmail.com>
Date:	Sat, 14 Apr 2012 01:27:58 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Lubos Lunak <l.lunak@...e.cz>
Cc:	Peter Seebach <peter.seebach@...driver.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH][RESEND] do not redefine userspace's NULL #define

On Sat, Apr 14, 2012 at 1:21 AM, Lubos Lunak <l.lunak@...e.cz> wrote:
>
>  How about the patch? Are there any *actual* problems with it or can it please
> go in?

If we're going to change that thing, I'd actually prefer to just move
it inside the #ifdef __KERNEL__ entirely, and get rid of the cplusplus
case.

IOW, something like this (obviously white-space-mangled) patch:

    diff --git a/include/linux/stddef.h b/include/linux/stddef.h
    index 6a40c76bdcf1..1747b6787b9e 100644
    --- a/include/linux/stddef.h
    +++ b/include/linux/stddef.h
    @@ -3,14 +3,10 @@

     #include <linux/compiler.h>

    +#ifdef __KERNEL__
    +
     #undef NULL
    -#if defined(__cplusplus)
    -#define NULL 0
    -#else
     #define NULL ((void *)0)
    -#endif
    -
    -#ifdef __KERNEL__

     enum {
     	false	= 0,

which protects the kernel NULL definition along with the whole
offsetof and true/false ones too. And just gets rid of the insane C++
case entirely.

                Linus
--
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