lkml.org 
[lkml]   [2014]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.5 09/71] cpuset: fix a race condition in __cpuset_node_allowed_softwall()
    Date
    3.5.7.33 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Li Zefan <lizefan@huawei.com>

    commit 99afb0fd5f05aac467ffa85c36778fec4396209b upstream.

    It's not safe to access task's cpuset after releasing task_lock().
    Holding callback_mutex won't help.

    Signed-off-by: Li Zefan <lizefan@huawei.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
    ---
    kernel/cpuset.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/kernel/cpuset.c b/kernel/cpuset.c
    index 2627f0d0..f1dec4b 100644
    --- a/kernel/cpuset.c
    +++ b/kernel/cpuset.c
    @@ -2327,9 +2327,9 @@ int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask)

    task_lock(current);
    cs = nearest_hardwall_ancestor(task_cs(current));
    + allowed = node_isset(node, cs->mems_allowed);
    task_unlock(current);

    - allowed = node_isset(node, cs->mems_allowed);
    mutex_unlock(&callback_mutex);
    return allowed;
    }
    --
    1.9.1


    \
     
     \ /
      Last update: 2014-03-31 18:01    [W:5.071 / U:0.132 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site