Re: [PATCH] [BUGFIX] update mm->owner even if no next owner.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Fri, Jun 10, 2011 at 12:30 PM, KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:

I think this can be a fix.
maybe good to CC Oleg.Â
==
>From dff52fb35af0cf36486965d19ee79e04b59f1dc4 Mon Sep 17 00:00:00 2001
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
Date: Fri, 10 Jun 2011 13:15:14 +0900
Subject: [PATCH] [BUGFIX] update mm->owner even if no next owner.

A panic is reported.

> Call Trace:
> Â[<ffffffff81139792>] mem_cgroup_from_task+0x15/0x17
> Â[<ffffffff8113a75a>] __mem_cgroup_try_charge+0x148/0x4b4
> Â[<ffffffff810493f3>] ? need_resched+0x23/0x2d
> Â[<ffffffff814cbf43>] ? preempt_schedule+0x46/0x4f
> Â[<ffffffff8113afe8>] mem_cgroup_charge_common+0x9a/0xce
> Â[<ffffffff8113b6d1>] mem_cgroup_newpage_charge+0x5d/0x5f
> Â[<ffffffff81134024>] khugepaged+0x5da/0xfaf
> Â[<ffffffff81078ea0>] ? __init_waitqueue_head+0x4b/0x4b
> Â[<ffffffff81133a4a>] ? add_mm_counter.constprop.5+0x13/0x13
> Â[<ffffffff81078625>] kthread+0xa8/0xb0
> Â[<ffffffff814d13e8>] ? sub_preempt_count+0xa1/0xb4
> Â[<ffffffff814d5664>] kernel_thread_helper+0x4/0x10
> Â[<ffffffff814ce858>] ? retint_restore_args+0x13/0x13
> Â[<ffffffff8107857d>] ? __init_kthread_worker+0x5a/0x5a

The code is.
> Â Â Â Â return container_of(task_subsys_state(p, mem_cgroup_subsys_id),
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â struct mem_cgroup, css);


What happens here is accssing a freed task struct "p" from mm->owner.
So, it's doubtful that mm->owner points to freed task struct.


But from the bug itself, it looks more likely kernel is hitting a freed p->cgroups, right?
If p is already freed, the kernel will fault onÂ
781cc62d: 8b 82 fc 08 00 00    mov  Â0x8fc(%edx),%eax

Then you will not get a value of 6b6b6b87, right?

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]