mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Li Zefan <lizefan@huawei.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Cgroups <cgroups@vger.kernel.org>
Subject: Re: [PATCH] cgroup: add a validation check to cgroup_add_cftyps()
Date: Tue, 18 Feb 2014 18:20:56 -0500	[thread overview]
Message-ID: <20140218232056.GL31892@mtj.dyndns.org> (raw)
In-Reply-To: <530176EE.6030605@huawei.com>

On Mon, Feb 17, 2014 at 10:41:50AM +0800, Li Zefan wrote:
> Fengguang reported this bug:
> 
> BUG: unable to handle kernel NULL pointer dereference at 0000003c
> IP: [<cc90b4ad>] cgroup_cfts_commit+0x27/0x1c1
> ...
> Call Trace:
>   [<cc9d1129>] ? kmem_cache_alloc_trace+0x33f/0x3b7
>   [<cc90c6fc>] cgroup_add_cftypes+0x8f/0xca
>   [<cd78b646>] cgroup_init+0x6a/0x26a
>   [<cd764d7d>] start_kernel+0x4d7/0x57a
>   [<cd7642ef>] i386_start_kernel+0x92/0x96
> 
> This happens in a corner case. If CGROUP_SCHED=y but CFS_BANDWIDTH=n &&
> FAIR_GROUP_SCHED=n && RT_GROUP_SCHED=n, we have:
> 
> cpu_files[] = {
> 	{ }	/* terminate */
> }
> 
> When we pass cpu_files to cgroup_apply_cftypes(), as cpu_files[0].ss
> is NULL, we'll access NULL pointer.
> 
> The bug was introduced by commit de00ffa56ea3132c6013fc8f07133b8a1014cf53
> ("cgroup: make cgroup_subsys->base_cftypes use cgroup_add_cftypes()").
> 
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Li Zefan <lizefan@huawei.com>

Applied to cgroup/for-3.15.  Thanks.

-- 
tejun

      reply	other threads:[~2014-02-18 23:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-17  2:41 Li Zefan
2014-02-18 23:20 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140218232056.GL31892@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®