lkml.org 
[lkml]   [2002]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectSegfault hidden in list.h
Date
The code inside of __list_add:

next->prev = new;
new->next = next;
new->prev = prev;
pre-next = new;

needs to be altered to:

new->prev = prev;
new->next = next;
next->prev = new;
prev->next = new;

If something is accessing the list in reverse at the time of insertion and
"next->prev = new;" has been executed, there exists a moment when new->prev
may contain garbage if the element had been used in another list and is
being transposed into a new one. Even if garbage is not present, and the
element had just been initialized (i.e. new->prev = new), a false list head
will appear briefly (from the executing thread's point of view).

Billy Rose
wrose@loislaw.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 13:26    [W:0.046 / U:1.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site