All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] suck some poison out of cgroups' linked lists
@ 2011-03-15 13:08 Phil Carmody
       [not found] ` <1300194523-19325-1-git-send-email-ext-phil.2.carmody-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Phil Carmody @ 2011-03-15 13:08 UTC (permalink / raw)
  To: menage, lizf; +Cc: containers, linux-kernel, akpm, ext-phil.2.carmody


I recently saw cgroup_attach_task drop this bomb:
[   46.045806] Unable to handle kernel paging request at virtual address 00200200
Which is clearly linked-list poison.

Dereferencing 00100104 has also been seen nearby according to a quick 
web-search that I did.

Apparently, whether nodes are on a list is being checked with list_empty(),
and if they're on a list, they're list_del()ed. According to a subsequent 
list_empty() check, they're still on a list, as list_del() doesn't turn
the nodes into singleton lists, it simply poisons both its pointers, and
merry poison dereferencing may ensue. Oops.

There are at least 2 to address this matter, I've gone for the latter:

1) Do not use list_empty() to check if a node is on a list or not. Have
an additional new function that checks to see whether the node is either
a singleton or is poisoned. Something like list_node_{on,off}_list()?

2) Ensure that you never leave poison anywhere where you might want
to use list_empty().

It might be that these oopses are seen only because there's a marginal
race in the cgroups code, as they seem to be very rare. In that case
this patchset might not fix the core problem, but might simply hide it.
Someone with more cgroups expertise might want to investigate that 
possibility.

Patch 1 is the "hindsight is 20/20" patch which would have made 
identifying the issue trivial.

Cheers,
Phil

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2011-03-22 10:18 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15 13:08 [PATCH 0/2] suck some poison out of cgroups' linked lists Phil Carmody
     [not found] ` <1300194523-19325-1-git-send-email-ext-phil.2.carmody-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2011-03-15 13:08   ` [PATCH 1/2] list.h: add debug version of list_empty Phil Carmody
2011-03-15 13:51   ` [PATCH 0/2] suck some poison out of cgroups' linked lists Christoph Hellwig
2011-03-15 13:08 ` [PATCH 1/2] list.h: add debug version of list_empty Phil Carmody
2011-03-15 13:08   ` [PATCH 2/2] cgroup: if you list_empty() a head then don't list_del() it Phil Carmody
     [not found]     ` <1300194523-19325-3-git-send-email-ext-phil.2.carmody-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2011-03-15 16:20       ` Paul Menage
2011-03-15 16:35       ` Kirill A. Shutemov
2011-03-15 16:20     ` Paul Menage
2011-03-15 16:35     ` Kirill A. Shutemov
     [not found]   ` <1300194523-19325-2-git-send-email-ext-phil.2.carmody-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2011-03-15 13:08     ` Phil Carmody
2011-03-21 23:52     ` [PATCH 1/2] list.h: add debug version of list_empty Andrew Morton
2011-03-21 23:52   ` Andrew Morton
2011-03-22 10:11     ` Phil Carmody
     [not found]     ` <20110321165206.1deaf0ab.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2011-03-22 10:11       ` Phil Carmody
2011-03-22 10:18       ` Kirill A. Shutemov
2011-03-22 10:18     ` Kirill A. Shutemov
2011-03-15 13:51 ` [PATCH 0/2] suck some poison out of cgroups' linked lists Christoph Hellwig
2011-03-15 14:01   ` Phil Carmody
2011-03-15 14:12     ` ext Christoph Hellwig
     [not found]     ` <20110315140153.GD18664-etG4378wJBqvwb7GHCYM64wBHEhOmDVPtqGf+n4yE6E@public.gmane.org>
2011-03-15 14:12       ` ext Christoph Hellwig
     [not found]   ` <20110315135137.GA27545-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2011-03-15 14:01     ` Phil Carmody

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.