lkml.org 
[lkml]   [2013]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PROBLEM: __list_del_entry in lib/list_debug.c does not delete the node if the list is corrupted
On Thu, Jan 17, 2013 at 03:53:11PM +0530, Shankar Brahadeeswaran wrote:
> Hi,
> The following is the Bug Report on list_debug.c implementation.
>
> [1.] The __list_del_entry implemented in lib/list_debug.c does not
> delete the node if the list is corrupted
>
> [2.] Full description of the problem/report:
> The function __list_del_entry implemented in include/linux/list.h
> always removes the node from the list it belongs to.
> But the same function implemented in lib/list_debug.c does not remove
> the node if the list it belongs to is corrupted.
> So based on whether CONFIG_DEBUG_LIST is defined or not the behavior
> of the function __list_del_entry changes

If the list is corrupt, we don't know if it's safe to do further
manipulation. Those nodes could be pointing anywhere, and dereferencing them
could lead to oopses, GPFs or even lockups depending on config options,
and what the corrupt pointers are.

> [2.1] Use Case in which the problem is seen (Assume that
> CONFIG_DEBUG_LIST is defined so implementation used is from
> list_debug.c)
> In the AOSP kernel version the file dpm_prepare in file
> drivers/base/power/main.c moves the "device" from dpm_list to
> dpm_prepare list.
> The following line of code does it.
>
> list_move_tail(&dev->power.entry, &dpm_prepared_list);
>
> Now the implementation of list_move_tail (include/linux/list.h) is as follows
> __list_del_entry(list);
> list_add_tail(list, head);
>
> If the list in which &dev->power.entry lives (dpm_list) is corrupted
> then the first call will not delete the node (Warning is thrown and
> returns)

Find out why that list is corrupt, and fix that.

Dave



\
 
 \ /
  Last update: 2013-01-17 16:21    [W:0.055 / U:2.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site