From: Phil Carmody <ext-phil.2.carmody@nokia.com>
To: menage@google.com, lizf@cn.fujitsu.com
Cc: containers@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
ext-phil.2.carmody@nokia.com
Subject: [PATCH 0/2] suck some poison out of cgroups' linked lists
Date: Tue, 15 Mar 2011 15:08:41 +0200 [thread overview]
Message-ID: <1300194523-19325-1-git-send-email-ext-phil.2.carmody@nokia.com> (raw)
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
next reply other threads:[~2011-03-15 13:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-15 13:08 Phil Carmody [this message]
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
2011-03-15 16:20 ` Paul Menage
2011-03-15 16:35 ` Kirill A. Shutemov
2011-03-21 23:52 ` [PATCH 1/2] list.h: add debug version of list_empty Andrew Morton
2011-03-22 10:11 ` Phil Carmody
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1300194523-19325-1-git-send-email-ext-phil.2.carmody@nokia.com \
--to=ext-phil.2.carmody@nokia.com \
--cc=akpm@linux-foundation.org \
--cc=containers@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®