Skip to content

Commit 7ab76d7

Browse files
Al ViroLinus Torvalds
authored andcommitted
[PATCH] frv: sysctl __user annotations
Add __user annotations to FRV-specific sysctl stuff. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 9e4d11f commit 7ab76d7

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

‎arch/frv/kernel/pm.c‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ unsigned long sleep_phys_sp(void *sp)
137137
#define CTL_PM_P0 4
138138
#define CTL_PM_CM 5
139139

140-
static int user_atoi(char *ubuf, size_t len)
140+
static int user_atoi(char __user *ubuf, size_t len)
141141
{
142142
char buf[16];
143143
unsigned long ret;
@@ -159,7 +159,7 @@ static int user_atoi(char *ubuf, size_t len)
159159
* Send us to sleep.
160160
*/
161161
static int sysctl_pm_do_suspend(ctl_table *ctl, int write, struct file *filp,
162-
void *buffer, size_t *lenp, loff_t *fpos)
162+
void __user *buffer, size_t *lenp, loff_t *fpos)
163163
{
164164
int retval, mode;
165165

@@ -215,7 +215,7 @@ static int try_set_cmode(int new_cmode)
215215

216216

217217
static int cmode_procctl(ctl_table *ctl, int write, struct file *filp,
218-
void *buffer, size_t *lenp, loff_t *fpos)
218+
void __user *buffer, size_t *lenp, loff_t *fpos)
219219
{
220220
int new_cmode;
221221

@@ -227,9 +227,9 @@ static int cmode_procctl(ctl_table *ctl, int write, struct file *filp,
227227
return try_set_cmode(new_cmode)?:*lenp;
228228
}
229229

230-
static int cmode_sysctl(ctl_table *table, int *name, int nlen,
231-
void *oldval, size_t *oldlenp,
232-
void *newval, size_t newlen, void **context)
230+
static int cmode_sysctl(ctl_table *table, int __user *name, int nlen,
231+
void __user *oldval, size_t __user *oldlenp,
232+
void __user *newval, size_t newlen, void **context)
233233
{
234234
if (oldval && oldlenp) {
235235
size_t oldlen;
@@ -240,7 +240,7 @@ static int cmode_sysctl(ctl_table *table, int *name, int nlen,
240240
if (oldlen != sizeof(int))
241241
return -EINVAL;
242242

243-
if (put_user(clock_cmode_current, (unsigned int *)oldval) ||
243+
if (put_user(clock_cmode_current, (unsigned __user *)oldval) ||
244244
put_user(sizeof(int), oldlenp))
245245
return -EFAULT;
246246
}
@@ -250,7 +250,7 @@ static int cmode_sysctl(ctl_table *table, int *name, int nlen,
250250
if (newlen != sizeof(int))
251251
return -EINVAL;
252252

253-
if (get_user(new_cmode, (int *)newval))
253+
if (get_user(new_cmode, (int __user *)newval))
254254
return -EFAULT;
255255

256256
return try_set_cmode(new_cmode)?:1;
@@ -318,7 +318,7 @@ static int try_set_cm(int new_cm)
318318
}
319319

320320
static int p0_procctl(ctl_table *ctl, int write, struct file *filp,
321-
void *buffer, size_t *lenp, loff_t *fpos)
321+
void __user *buffer, size_t *lenp, loff_t *fpos)
322322
{
323323
int new_p0;
324324

@@ -330,9 +330,9 @@ static int p0_procctl(ctl_table *ctl, int write, struct file *filp,
330330
return try_set_p0(new_p0)?:*lenp;
331331
}
332332

333-
static int p0_sysctl(ctl_table *table, int *name, int nlen,
334-
void *oldval, size_t *oldlenp,
335-
void *newval, size_t newlen, void **context)
333+
static int p0_sysctl(ctl_table *table, int __user *name, int nlen,
334+
void __user *oldval, size_t __user *oldlenp,
335+
void __user *newval, size_t newlen, void **context)
336336
{
337337
if (oldval && oldlenp) {
338338
size_t oldlen;
@@ -343,7 +343,7 @@ static int p0_sysctl(ctl_table *table, int *name, int nlen,
343343
if (oldlen != sizeof(int))
344344
return -EINVAL;
345345

346-
if (put_user(clock_p0_current, (unsigned int *)oldval) ||
346+
if (put_user(clock_p0_current, (unsigned __user *)oldval) ||
347347
put_user(sizeof(int), oldlenp))
348348
return -EFAULT;
349349
}
@@ -353,7 +353,7 @@ static int p0_sysctl(ctl_table *table, int *name, int nlen,
353353
if (newlen != sizeof(int))
354354
return -EINVAL;
355355

356-
if (get_user(new_p0, (int *)newval))
356+
if (get_user(new_p0, (int __user *)newval))
357357
return -EFAULT;
358358

359359
return try_set_p0(new_p0)?:1;
@@ -362,7 +362,7 @@ static int p0_sysctl(ctl_table *table, int *name, int nlen,
362362
}
363363

364364
static int cm_procctl(ctl_table *ctl, int write, struct file *filp,
365-
void *buffer, size_t *lenp, loff_t *fpos)
365+
void __user *buffer, size_t *lenp, loff_t *fpos)
366366
{
367367
int new_cm;
368368

@@ -374,9 +374,9 @@ static int cm_procctl(ctl_table *ctl, int write, struct file *filp,
374374
return try_set_cm(new_cm)?:*lenp;
375375
}
376376

377-
static int cm_sysctl(ctl_table *table, int *name, int nlen,
378-
void *oldval, size_t *oldlenp,
379-
void *newval, size_t newlen, void **context)
377+
static int cm_sysctl(ctl_table *table, int __user *name, int nlen,
378+
void __user *oldval, size_t __user *oldlenp,
379+
void __user *newval, size_t newlen, void **context)
380380
{
381381
if (oldval && oldlenp) {
382382
size_t oldlen;
@@ -387,7 +387,7 @@ static int cm_sysctl(ctl_table *table, int *name, int nlen,
387387
if (oldlen != sizeof(int))
388388
return -EINVAL;
389389

390-
if (put_user(clock_cm_current, (unsigned int *)oldval) ||
390+
if (put_user(clock_cm_current, (unsigned __user *)oldval) ||
391391
put_user(sizeof(int), oldlenp))
392392
return -EFAULT;
393393
}
@@ -397,7 +397,7 @@ static int cm_sysctl(ctl_table *table, int *name, int nlen,
397397
if (newlen != sizeof(int))
398398
return -EINVAL;
399399

400-
if (get_user(new_cm, (int *)newval))
400+
if (get_user(new_cm, (int __user *)newval))
401401
return -EFAULT;
402402

403403
return try_set_cm(new_cm)?:1;

‎arch/frv/kernel/sysctl.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static void frv_change_dcache_mode(unsigned long newmode)
4949
* handle requests to dynamically switch the write caching mode delivered by /proc
5050
*/
5151
static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
52-
void *buffer, size_t *lenp, loff_t *ppos)
52+
void __user *buffer, size_t *lenp, loff_t *ppos)
5353
{
5454
unsigned long hsr0;
5555
char buff[8];
@@ -123,7 +123,7 @@ static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
123123
*/
124124
#ifdef CONFIG_MMU
125125
static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
126-
void *buffer, size_t *lenp, loff_t *ppos)
126+
void __user *buffer, size_t *lenp, loff_t *ppos)
127127
{
128128
pid_t pid;
129129
char buff[16], *p;

0 commit comments

Comments
 (0)