summaryrefslogtreecommitdiff
blob: ed79ad00ea6931feb21625c4afc01615d31fdb94 (plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
Index: vserver-sources-2.6.16_2.1.1/fs/ext3/ioctl.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/fs/ext3/ioctl.c
+++ vserver-sources-2.6.16_2.1.1/fs/ext3/ioctl.c
@@ -260,7 +260,7 @@ flags_err:
 			return -EROFS;
 		if (!(inode->i_sb->s_flags & MS_TAGGED))
 			return -ENOSYS;
-		if (get_user(tag, (int *) arg))
+		if (get_user(tag, (int __user *) arg))
 			return -EFAULT;
 
 		handle = ext3_journal_start(inode, 1);
Index: vserver-sources-2.6.16_2.1.1/fs/ioctl.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/fs/ioctl.c
+++ vserver-sources-2.6.16_2.1.1/fs/ioctl.c
@@ -164,7 +164,7 @@ int vfs_ioctl(struct file *filp, unsigne
 			/* fixme: if stealth, return -ENOTTY */
 			error = -EPERM;
 			if (capable(CAP_CONTEXT))
-				error = put_user(inode->i_tag, (int *) arg);
+				error = put_user(inode->i_tag, (int __user *) arg);
 			break;
 		}
 		case FIOC_SETTAG: {
@@ -182,7 +182,7 @@ int vfs_ioctl(struct file *filp, unsigne
 			if (!(inode->i_sb->s_flags & MS_TAGGED))
 				break;
 			error = -EFAULT;
-			if (get_user(tag, (int *) arg))
+			if (get_user(tag, (int __user *) arg))
 				break;
 			error = 0;
 			inode->i_tag = (tag & 0xFFFF);
Index: vserver-sources-2.6.16_2.1.1/kernel/sys.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/kernel/sys.c
+++ vserver-sources-2.6.16_2.1.1/kernel/sys.c
@@ -484,7 +484,7 @@ void kernel_power_off(void)
 }
 EXPORT_SYMBOL_GPL(kernel_power_off);
 
-long vs_reboot(unsigned int, void *);
+long vs_reboot(unsigned int, void __user *);
 
 /*
  * Reboot system call: for obvious reasons only root may call it,
Index: vserver-sources-2.6.16_2.1.1/kernel/vserver/context.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/kernel/vserver/context.c
+++ vserver-sources-2.6.16_2.1.1/kernel/vserver/context.c
@@ -931,7 +931,7 @@ int vc_set_cflags(uint32_t id, void __us
 	return 0;
 }
 
-int do_get_caps(xid_t xid, uint64_t *bcaps, uint64_t *ccaps)
+static int do_get_caps(xid_t xid, uint64_t *bcaps, uint64_t *ccaps)
 {
 	struct vx_info *vxi;
 
@@ -978,7 +978,7 @@ int vc_get_ccaps(uint32_t id, void __use
 	return 0;
 }
 
-int do_set_caps(xid_t xid, uint64_t bcaps, uint64_t bmask,
+static int do_set_caps(xid_t xid, uint64_t bcaps, uint64_t bmask,
 	uint64_t ccaps, uint64_t cmask)
 {
 	struct vx_info *vxi;
Index: vserver-sources-2.6.16_2.1.1/kernel/vserver/dlimit.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/kernel/vserver/dlimit.c
+++ vserver-sources-2.6.16_2.1.1/kernel/vserver/dlimit.c
@@ -183,7 +183,7 @@ void rcu_free_dl_info(struct rcu_head *h
 
 
 
-int do_addrem_dlimit(uint32_t id, const char __user *name,
+static int do_addrem_dlimit(uint32_t id, const char __user *name,
 	uint32_t flags, int add)
 {
 	struct nameidata nd;
Index: vserver-sources-2.6.16_2.1.1/kernel/vserver/helper.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/kernel/vserver/helper.c
+++ vserver-sources-2.6.16_2.1.1/kernel/vserver/helper.c
@@ -24,7 +24,7 @@
 char vshelper_path[255] = "/sbin/vshelper";
 
 
-int do_vshelper(char *name, char *argv[], char *envp[], int sync)
+static int do_vshelper(char *name, char *argv[], char *envp[], int sync)
 {
 	int ret;
 
@@ -52,7 +52,7 @@ int do_vshelper(char *name, char *argv[]
  *      envp [*] = type-specific parameters
  */
 
-long vs_reboot_helper(struct vx_info *vxi, int cmd, void *arg)
+long vs_reboot_helper(struct vx_info *vxi, int cmd, void __user *arg)
 {
 	char id_buf[8], cmd_buf[16];
 	char uid_buf[16], pid_buf[16];
@@ -106,7 +106,7 @@ long vs_reboot_helper(struct vx_info *vx
 }
 
 
-long vs_reboot(unsigned int cmd, void * arg)
+long vs_reboot(unsigned int cmd, void __user * arg)
 {
 	struct vx_info *vxi = current->vx_info;
 	long ret = 0;
Index: vserver-sources-2.6.16_2.1.1/kernel/vserver/inode.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/kernel/vserver/inode.c
+++ vserver-sources-2.6.16_2.1.1/kernel/vserver/inode.c
@@ -273,7 +273,7 @@ int vx_proc_ioctl(struct inode * inode, 
 		error = -EPERM;
 		flags = entry->vx_flags;
 		if (capable(CAP_CONTEXT))
-			error = put_user(flags, (int *) arg);
+			error = put_user(flags, (int __user *) arg);
 		break;
 	}
 	case FIOC_SETXFLG: {
@@ -285,7 +285,7 @@ int vx_proc_ioctl(struct inode * inode, 
 		if (IS_RDONLY(inode))
 			break;
 		error = -EFAULT;
-		if (get_user(flags, (int *) arg))
+		if (get_user(flags, (int __user *) arg))
 			break;
 		error = 0;
 		entry->vx_flags = flags;
Index: vserver-sources-2.6.16_2.1.1/kernel/vserver/limit.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/kernel/vserver/limit.c
+++ vserver-sources-2.6.16_2.1.1/kernel/vserver/limit.c
@@ -75,7 +75,7 @@ static inline uint64_t vc_get_hard(struc
 	return VX_VLIM(limit);
 }
 
-int do_get_rlimit(xid_t xid, uint32_t id,
+static int do_get_rlimit(xid_t xid, uint32_t id,
 	uint64_t *minimum, uint64_t *softlimit, uint64_t *maximum)
 {
 	struct vx_info *vxi;
@@ -115,7 +115,7 @@ int vc_get_rlimit(uint32_t id, void __us
 	return 0;
 }
 
-int do_set_rlimit(xid_t xid, uint32_t id,
+static int do_set_rlimit(xid_t xid, uint32_t id,
 	uint64_t minimum, uint64_t softlimit, uint64_t maximum)
 {
 	struct vx_info *vxi;
Index: vserver-sources-2.6.16_2.1.1/kernel/vserver/proc.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/kernel/vserver/proc.c
+++ vserver-sources-2.6.16_2.1.1/kernel/vserver/proc.c
@@ -302,7 +302,7 @@ static int proc_vid_revalidate(struct de
 
 #define PROC_BLOCK_SIZE (PAGE_SIZE - 1024)
 
-static ssize_t proc_vid_info_read(struct file * file, char * buf,
+static ssize_t proc_vid_info_read(struct file * file, char __user * buf,
 			  size_t count, loff_t *ppos)
 {
 	struct inode * inode = file->f_dentry->d_inode;
@@ -332,11 +332,11 @@ static ssize_t proc_vid_info_read(struct
 /* here comes the lower level (vid) */
 
 static struct file_operations proc_vid_info_file_operations = {
-	read:		proc_vid_info_read,
+	.read =		proc_vid_info_read,
 };
 
 static struct dentry_operations proc_vid_dentry_operations = {
-	d_revalidate:	proc_vid_revalidate,
+	.d_revalidate =	proc_vid_revalidate,
 };
 
 
@@ -504,12 +504,12 @@ static int proc_vid_readdir(struct file 
 /* now the upper level (virtual) */
 
 static struct file_operations proc_vid_file_operations = {
-	read:		generic_read_dir,
-	readdir:	proc_vid_readdir,
+	.read =		generic_read_dir,
+	.readdir =	proc_vid_readdir,
 };
 
 static struct inode_operations proc_vid_inode_operations = {
-	lookup:		proc_vid_lookup,
+	.lookup =	proc_vid_lookup,
 };
 
 
@@ -771,12 +771,12 @@ int proc_virtual_readdir(struct file * f
 
 
 static struct file_operations proc_virtual_dir_operations = {
-	read:		generic_read_dir,
-	readdir:	proc_virtual_readdir,
+	.read =		generic_read_dir,
+	.readdir =	proc_virtual_readdir,
 };
 
 static struct inode_operations proc_virtual_dir_inode_operations = {
-	lookup:		proc_virtual_lookup,
+	.lookup =	proc_virtual_lookup,
 };
 
 
@@ -832,12 +832,12 @@ int proc_vnet_readdir(struct file * filp
 
 
 static struct file_operations proc_vnet_dir_operations = {
-	read:		generic_read_dir,
-	readdir:	proc_vnet_readdir,
+	.read =		generic_read_dir,
+	.readdir =	proc_vnet_readdir,
 };
 
 static struct inode_operations proc_vnet_dir_inode_operations = {
-	lookup:		proc_vnet_lookup,
+	.lookup =	proc_vnet_lookup,
 };
 
 
Index: vserver-sources-2.6.16_2.1.1/kernel/vserver/sched.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/kernel/vserver/sched.c
+++ vserver-sources-2.6.16_2.1.1/kernel/vserver/sched.c
@@ -188,7 +188,7 @@ on_hold:
 }
 
 
-int do_set_sched(struct vx_info *vxi, struct vcmd_set_sched_v4 *data)
+static int do_set_sched(struct vx_info *vxi, struct vcmd_set_sched_v4 *data)
 {
 	unsigned int set_mask = data->set_mask;
 	unsigned int update_mask;
Index: vserver-sources-2.6.16_2.1.1/mm/filemap.c
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/mm/filemap.c
+++ vserver-sources-2.6.16_2.1.1/mm/filemap.c
@@ -2258,7 +2258,7 @@ generic_kernel_file_aio_write_nolock(str
 	/* There is no sane reason to use O_DIRECT */
 	BUG_ON(file->f_flags & O_DIRECT);
 
-	buf = iov->iov_base;
+	buf = (char __user *)iov->iov_base;
 	do {
 		unsigned long index;
 		unsigned long offset;
Index: vserver-sources-2.6.16_2.1.1/mm/slab_vs.h
===================================================================
--- vserver-sources-2.6.16_2.1.1.orig/mm/slab_vs.h
+++ vserver-sources-2.6.16_2.1.1/mm/slab_vs.h
@@ -2,7 +2,7 @@
 static inline
 void vx_slab_alloc(struct kmem_cache *cachep, gfp_t flags)
 {
-	int what = cachep->gfpflags & GFP_ZONEMASK;
+	int what = gfp_zone(cachep->gfpflags);
 
 	if (!current->vx_info)
 		return;
@@ -13,7 +13,7 @@ void vx_slab_alloc(struct kmem_cache *ca
 static inline
 void vx_slab_free(struct kmem_cache *cachep)
 {
-	int what = cachep->gfpflags & GFP_ZONEMASK;
+	int what = gfp_zone(cachep->gfpflags);
 
 	if (!current->vx_info)
 		return;