diff options
author | Phil Carmody <ext-phil.2.carmody@nokia.com> | 2011-03-22 23:30:13 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-23 00:43:58 (GMT) |
commit | 8d2587970b8bdf7c8d9208e3f4bb93182aef1a0f (patch) | |
tree | 931cacaa98583412975b4601b62fb244a5ed678d /fs/hpfs | |
parent | edd45544c6f09550df0a5491aa8a07af24767e73 (diff) | |
download | linux-fsl-qoriq-8d2587970b8bdf7c8d9208e3f4bb93182aef1a0f.tar.xz |
cgroups: if you list_empty() a head then don't list_del() it
list_del() leaves poison in the prev and next pointers. The next
list_empty() will compare those poisons, and say the list isn't empty.
Any list operations that assume the node is on a list because of such a
check will be fooled into dereferencing poison. One needs to INIT the
node after the del, and fortunately there's already a wrapper for that -
list_del_init().
Some of the dels are followed by deallocations, so can be ignored, and one
can be merged with an add to make a move. Apart from that, I erred on the
side of caution in making nodes list_empty()-queriable.
Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Reviewed-by: Paul Menage <menage@google.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hpfs')
0 files changed, 0 insertions, 0 deletions