cgroup: initialize xattr before calling d_instantiate()
authorLi Zefan <lizefan@huawei.com>
Tue, 14 May 2013 11:44:20 +0000 (19:44 +0800)
committerTejun Heo <tj@kernel.org>
Tue, 14 May 2013 15:24:15 +0000 (08:24 -0700)
commitd6cbf35dac8a3dadb9103379820c96d7c85df3d9
treebd25f2bebf2620ab87440e1e8b167e7bf3cdca20
parentf722406faae2d073cc1d01063d1123c35425939e
cgroup: initialize xattr before calling d_instantiate()

cgroup_create_file() calls d_instantiate(), which may decide to look
at the xattrs on the file. Smack always does this and SELinux can be
configured to do so.

But cgroup_add_file() didn't initialize xattrs before calling
cgroup_create_file(), which finally leads to dereferencing NULL
dentry->d_fsdata.

This bug has been there since cgroup xattr was introduced.

Cc: <stable@vger.kernel.org> # 3.8.x
Reported-by: Ivan Bulatovic <combuster@archlinux.us>
Reported-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup.c