1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
Index: linux-2.6.18/include/linux/vserver/network.h
===================================================================
--- linux-2.6.18.orig/include/linux/vserver/network.h
+++ linux-2.6.18/include/linux/vserver/network.h
@@ -14,6 +14,7 @@
/* network flags */
#define NXF_INFO_LOCK 0x00000001
+#define NXF_INFO_PRIVATE 0x00000008
#define NXF_STATE_SETUP (1ULL<<32)
#define NXF_STATE_ADMIN (1ULL<<34)
Index: linux-2.6.18/kernel/vserver/context.c
===================================================================
--- linux-2.6.18.orig/kernel/vserver/context.c
+++ linux-2.6.18/kernel/vserver/context.c
@@ -585,7 +585,7 @@ int vx_migrate_user(struct task_struct *
if (!p || !vxi)
BUG();
- if (vx_info_flags(vxi, VXF_INFO_LOCK, 0))
+ if (vx_info_flags(vxi, VXF_INFO_PRIVATE, 0))
return -EACCES;
new_user = alloc_uid(vxi->vx_id, p->uid);
@@ -650,13 +650,17 @@ int vx_migrate_task(struct task_struct *
"vx_migrate_task(%p,%p[#%d.%d])", p, vxi,
vxi->vx_id, atomic_read(&vxi->vx_usecnt));
- if (vx_info_flags(vxi, VXF_INFO_LOCK, 0))
+ if (vx_info_flags(vxi, VXF_INFO_PRIVATE, 0))
return -EACCES;
old_vxi = task_get_vx_info(p);
if (old_vxi == vxi)
goto out;
+ ret =-EACCES;
+ if (vx_info_flags(old_vxi, VXF_INFO_LOCK, 0))
+ goto out;
+
if (!(ret = vx_migrate_user(p, vxi))) {
int openfd;
Index: linux-2.6.18/kernel/vserver/namespace.c
===================================================================
--- linux-2.6.18.orig/kernel/vserver/namespace.c
+++ linux-2.6.18/kernel/vserver/namespace.c
@@ -33,7 +33,7 @@ int vx_enter_namespace(struct vx_info *v
struct fs_struct *old_fs, *fs;
struct namespace *old_ns;
- if (vx_info_flags(vxi, VXF_INFO_LOCK, 0))
+ if (vx_info_flags(vxi, VXF_INFO_PRIVATE, 0))
return -EACCES;
if (!vxi->vx_namespace)
return -EINVAL;
Index: linux-2.6.18/kernel/vserver/network.c
===================================================================
--- linux-2.6.18.orig/kernel/vserver/network.c
+++ linux-2.6.18/kernel/vserver/network.c
@@ -387,7 +387,7 @@ int nx_migrate_task(struct task_struct *
atomic_read(&nxi->nx_usecnt),
atomic_read(&nxi->nx_tasks));
- if (nx_info_flags(nxi, NXF_INFO_LOCK, 0))
+ if (nx_info_flags(nxi, NXF_INFO_PRIVATE, 0))
return -EACCES;
/* maybe disallow this completely? */
@@ -395,6 +395,10 @@ int nx_migrate_task(struct task_struct *
if (old_nxi == nxi)
goto out;
+ ret =-EACCES;
+ if (nx_info_flags(old_nxi, NXF_INFO_LOCK, 0))
+ goto out;
+
task_lock(p);
if (old_nxi)
clr_nx_info(&p->nx_info);
|