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:	Tue, 14 Jun 2011 14:24:02 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Andy Lutomirski <luto@....edu>,
	Rakib Mullick <rakib.mullick@...il.com>, hpa@...or.com,
	tglx@...utronix.de, x86@...nel.org, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] x86, vsyscall: Fix build warning in vsyscall_64.c

On Tue, Jun 14, 2011 at 2:16 PM, Ingo Molnar <mingo@...e.hu> wrote:
>
> I think correctness trumps code size and turning BUG() and BUG_ON()
> into a NOP is just crazy ...

Umm. It's even CRAZIER to turn it into a "compiler generates random code".

Which is what "unreachable()" ends up doing (different compilers will
generate different things - ranging from an infinite loop, to a "nop
with random behavior after it because gcc decided that it doesn't need
to pop arguments off the stack and just runs into random code
instead").

So a NOP is a *hell* of a lot better than turning BUG_ON() into
something random.

The only (and I mean *only*) valid use-case for unreachable() is after
an inline asm that really causes the next instruction to be
unreachable(), but the compiler just doesn't understand it. It is
*not* valid for that kind of crazy "if (condition) do-random-thing"
crap.

Seriously. If you want a "do random thing" thing, don't call it
BUG_ON(). Call it "I_M_A_FUCKING_MORON()".

There is no way I will ever accept a moronic patch like that.

Really.

                     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