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:	Mon, 08 Jun 2015 11:16:31 +0200
From:	Alexander Holler <holler@...oftware.de>
To:	Ingo Molnar <mingo@...nel.org>
CC:	Richard Weinberger <richard.weinberger@...il.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Tejun Heo <htejun@...il.com>,
	Louis Langholtz <lou_langholtz@...com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Trivial patch monkey <trivial@...nel.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Thomas Gleixner <tglx@...utronix.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] debug: Deprecate BUG_ON() use in new code, introduce
 CRASH_ON()

Am 08.06.2015 um 11:05 schrieb Ingo Molnar:
>
> * Alexander Holler <holler@...oftware.de> wrote:
>
>> Am 08.06.2015 um 10:08 schrieb Richard Weinberger:
>>> On Mon, Jun 8, 2015 at 9:40 AM, Alexander Holler <holler@...oftware.de> wrote:
>>>> Am 08.06.2015 um 09:12 schrieb Ingo Molnar:
>>>>>
>>>>>
>>>>> * Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>>>>>
>>>>>> Stop with the random BUG_ON() additions.
>>>>>
>>>>>
>>>>> Yeah, so I propose the attached patch which attempts to resist new
>>>>> BUG_ON()
>>>>> additions.
>>>>
>>>>
>>>> As this reminded me at flame I received once from a maintainer because I
>>>> wanted to avoid a desastrous memory corruption by using a BUG_ON().
>>>
>>> Reference?
>>
>> https://lkml.org/lkml/2013/5/17/254
>>
>> To explain: The bug already existed for several releases and the memory
>> corruption was that desatrous that it even leaded here to hard resets of systems
>> without any oops. And fixing it needed several more releases (another year).
>>
>> And in the above mentioned case and the kernel config settings I use(d), only
>> the wronggoing thread was killed by the BUG_ON (I proposed) before it had the
>> chance to corrupt the memory.
>
> Firstly, the changelog of the patch that Greg rejected told nothing about all that
> thinking, so at minimum it's a deficient changelog.
>
> Secondly and more importantly, instead of doing a BUG_ON() you could have done:
>
> 	if (WARN_ON_ONCE(port->itty))
> 		return;
>
> This would probably have prevented the tty related memory corruption just as much,
> at the cost of a (small and infrequent) memory leak.
>
> I.e. instead of crashing the machine, you need to try to find the least
> destructive approach if a bug is detected.
>
> I am pretty certain that Greg would have applied such a patch in an eye blink.

As you've said it, *probably*. But such a simple exit path as you're 
proposing doesn't always exist. And I assume if it would have existed, 
it would not have needed another year to get rid of at least the memory 
corruption. It took me quiet some time to find the problem and I'm sure, 
if I had seen during my adventures through the tty-subsystem that such a 
simple return would have been enough, I would have used WARN_ON or 
WARN_ON_ONCE. But I can't remember.

Alexander Holler
--
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