lkml.org 
[lkml]   [2002]   [Aug]   [2]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 02 Aug 2002 10:37:22 -0700
FromDave Hansen <>
SubjectRe: [RFC] Race condition?
Oliver Neukum wrote:
> Am Freitag, 2. August 2002 15:46 schrieb Kasper Dupont:
> 
>>Is there a race condition in this piece of code from do_fork in
> 
> It would seem so. Perhaps the BKL was taken previously.
> 

Even if it was, I doubt the code ever knowingly relied upon it.  If I 
know that I'm protected under a lock, I rarely go to the trouble of 
atomic operations.

The root of the problem is that the reference count is being relied on 
for the wrong thing.  There is a race on p->user between the
dup_task_struct() and whenever the atomic_inc(&p->user->__count) 
occcurs.   The user reference count needs to be incremented in 
dup_task_struct(), before the copy occurs.
-- 
Dave Hansen
haveblue@us.ibm.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:22    [W:0.435 / U:0.200 seconds]
©2003-2008 Jasper Spaans