summaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorLi Zefan2013-04-19 08:09:52 +0200
committerTejun Heo2013-04-19 08:11:40 +0200
commit712317ad97f41e738e1a19aa0a6392a78a84094e (patch)
tree66988449eb8cca53e032eed6ddc1169f9296eeac /include/linux/cgroup.h
parentdevcg: remove parent_cgroup. (diff)
downloadkernel-qcow2-linux-712317ad97f41e738e1a19aa0a6392a78a84094e.tar.gz
kernel-qcow2-linux-712317ad97f41e738e1a19aa0a6392a78a84094e.tar.xz
kernel-qcow2-linux-712317ad97f41e738e1a19aa0a6392a78a84094e.zip
cgroup: fix broken file xattrs
We should store file xattrs in struct cfent instead of struct cftype, because cftype is a type while cfent is object instance of cftype. For example each cgroup has a tasks file, and each tasks file is associated with a uniq cfent, but all those files share the same struct cftype. Alexey Kodanev reported a crash, which can be reproduced: # mount -t cgroup -o xattr /sys/fs/cgroup # mkdir /sys/fs/cgroup/test # setfattr -n trusted.value -v test_value /sys/fs/cgroup/tasks # rmdir /sys/fs/cgroup/test # umount /sys/fs/cgroup oops! In this case, simple_xattrs_free() will free the same struct simple_xattrs twice. tj: Dropped unused local variable @cft from cgroup_diput(). Cc: <stable@vger.kernel.org> # 3.8.x Reported-by: Alexey Kodanev <alexey.kodanev@oracle.com> Signed-off-by: Li Zefan <lizefan@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index cda7eb2239e1..c371888298d5 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -422,9 +422,6 @@ struct cftype {
/* CFTYPE_* flags */
unsigned int flags;
- /* file xattrs */
- struct simple_xattrs xattrs;
-
int (*open)(struct inode *inode, struct file *file);
ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft,
struct file *file,