[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20100315090451.ebd0ea2c.kamezawa.hiroyu@jp.fujitsu.com>
Date: Mon, 15 Mar 2010 09:04:51 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: Dan Carpenter <error27@...il.com>
Cc: Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
Andrew Morton <akpm@...ux-foundation.org>,
"Kirill A. Shutemov" <kirill@...temov.name>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Balbir Singh <balbir@...ux.vnet.ibm.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: Re: [patch] memcontrol: fix potential null deref
On Sat, 13 Mar 2010 17:56:21 +0300
Dan Carpenter <error27@...il.com> wrote:
> There was a potential null deref introduced in:
> c62b1a3b31b5 memcg: use generic percpu instead of private implementation
>
> Signed-off-by: Dan Carpenter <error27@...il.com>
Thanks.
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 7973b52..e1e0996 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3691,8 +3691,10 @@ static struct mem_cgroup *mem_cgroup_alloc(void)
> else
> mem = vmalloc(size);
>
> - if (mem)
> - memset(mem, 0, size);
> + if (!mem)
> + return NULL;
> +
> + memset(mem, 0, size);
> mem->stat = alloc_percpu(struct mem_cgroup_stat_cpu);
> if (!mem->stat) {
> if (size < PAGE_SIZE)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists