Magellan Linux

Contents of /trunk/kernel26-magellan/patches-2.6.35-r3/0300-2.6.35-cgroup.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1136 - (show annotations) (download)
Sat Sep 18 11:01:49 2010 UTC (13 years, 7 months ago) by niro
File size: 1677 byte(s)
-2.6.35-magellan-r3; added patch to fix CVE-2010-3301
1 see: http://lkml.org/lkml/2010/7/22/384
2 and: http://cgit.freedesktop.org/systemd/commit/?id=77d5f105bf63330350c7bddacdeda914f945590f
3
4 We really shouldn't be asking userspace to create new root filesystems.
5 So follow along with all of the other in-kernel filesystems, and provide
6 a mount point in sysfs.
7
8 For cgroupfs, this should be in /sys/fs/cgroup/ This change provides
9 that mount point when the cgroup filesystem is registered in the kernel.
10
11 Cc: Paul Menage <menage@google.com>
12 Cc: Li Zefan <lizf@cn.fujitsu.com>
13 Cc: Lennart Poettering <lennart@poettering.net>
14 Cc: Kay Sievers <kay.sievers@vrfy.org>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16
17 --- a/kernel/cgroup.c
18 +++ b/kernel/cgroup.c
19 @@ -1623,6 +1623,8 @@ static struct file_system_type cgroup_fs_type = {
20 .kill_sb = cgroup_kill_sb,
21 };
22
23 +static struct kobject *cgroup_kobj;
24 +
25 static inline struct cgroup *__d_cgrp(struct dentry *dentry)
26 {
27 return dentry->d_fsdata;
28 @@ -3871,9 +3873,18 @@ int __init cgroup_init(void)
29 hhead = css_set_hash(init_css_set.subsys);
30 hlist_add_head(&init_css_set.hlist, hhead);
31 BUG_ON(!init_root_id(&rootnode));
32 +
33 + cgroup_kobj = kobject_create_and_add("cgroup", fs_kobj);
34 + if (!cgroup_kobj) {
35 + err = -ENOMEM;
36 + goto out;
37 + }
38 +
39 err = register_filesystem(&cgroup_fs_type);
40 - if (err < 0)
41 + if (err < 0) {
42 + kobject_put(cgroup_kobj);
43 goto out;
44 + }
45
46 proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations);
47
48 --
49 To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
50 the body of a message to majordomo@vger.kernel.org
51 More majordomo info at http://vger.kernel.org/majordomo-info.html
52 Please read the FAQ at http://www.tux.org/lkml/