lkml.org 
[lkml]   [2017]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kref: Avoid null pointer dereference after WARN
On Tue, Jun 27, 2017 at 09:06:26AM +0200, Greg Kroah-Hartman wrote:
> I remember one complaint was that WARN_ON was "huge" and this bloated
> the kernel code a lot. But then that got fixed up. Is BUG_ON going to
> cause the same complaint again?

Complaint or not, I'm pretty sure using BUG_ON here is the right
behavior. If removing it will result in a null pointer dereference (and
subsequent function call), that's bad news bears, especially on systems
with a zero mmap_min_addr or combined with other bugs.

If somehow a driver manages to pass a NULL as the release function,
something is really messed up and the kernel should "safely" panic
instead.

>
> thanks,
>
> greg k-h

--
Jason A. Donenfeld
Deep Space Explorer
fr: +33 6 51 90 82 66
us: +1 513 476 1200
www.jasondonenfeld.com
www.zx2c4.com
zx2c4.com/keys/AB9942E6D4A4CFC3412620A749FC7012A5DE03AE.asc

\
 
 \ /
  Last update: 2017-06-27 13:02    [W:0.591 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site