lkml.org 
[lkml]   [2012]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mce: fix warning messages about static struct mce_device
On Thu, 19 Jan 2012, Srivatsa S. Bhat wrote:

> On 01/19/2012 06:02 PM, Ingo Molnar wrote:

> > But this is not what happened here - it's a special piece of
> > fundamental hardware that doesnt hot-plug separately from the
> > CPU and that has just a single "user".
> >
> > So i'm curious, why wasn't the memset() enough? It should have
> > resolved the bug AFAICS.
> >
>
>
> It did! The memset _did_ fix the bug.

But will it continue to fix the bug in the future?

Or to put it another way, even though no code takes references to these
device structures (can you really guarantee that even now?), how do you
prevent references being taken in future versions of the kernel?
Calling memset while there still are outstanding references very
definitely _is_ a bug.

IIRC, it used to be completely impossible to prevent this from
happening because sysfs would take references whenever user tasks
opened attribute files. Sysfs no longer does this, but the basic
principle of defensive programming still applies.

Alan Stern



\
 
 \ /
  Last update: 2012-01-19 16:15    [W:0.236 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site