aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/hpux/sys_hpux.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/hpux/sys_hpux.c')
-rw-r--r--arch/parisc/hpux/sys_hpux.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c
index 04c2ff444396..c57fcb4b2173 100644
--- a/arch/parisc/hpux/sys_hpux.c
+++ b/arch/parisc/hpux/sys_hpux.c
@@ -61,7 +61,7 @@ int hpux_ptrace(void)
61 return -ENOSYS; 61 return -ENOSYS;
62} 62}
63 63
64int hpux_wait(int *stat_loc) 64int hpux_wait(int __user *stat_loc)
65{ 65{
66 return sys_waitpid(-1, stat_loc, 0); 66 return sys_waitpid(-1, stat_loc, 0);
67} 67}
@@ -255,7 +255,7 @@ asmlinkage long hpux_fstatfs(unsigned int fd, struct hpux_statfs __user * buf)
255/* TODO: Are these put_user calls OK? Should they pass an int? 255/* TODO: Are these put_user calls OK? Should they pass an int?
256 * (I copied it from sys_i386.c like this.) 256 * (I copied it from sys_i386.c like this.)
257 */ 257 */
258static int hpux_uname(struct hpux_utsname *name) 258static int hpux_uname(struct hpux_utsname __user *name)
259{ 259{
260 int error; 260 int error;
261 261
@@ -300,14 +300,14 @@ static int hpux_uname(struct hpux_utsname *name)
300/* Note: HP-UX just uses the old suser() function to check perms 300/* Note: HP-UX just uses the old suser() function to check perms
301 * in this system call. We'll use capable(CAP_SYS_ADMIN). 301 * in this system call. We'll use capable(CAP_SYS_ADMIN).
302 */ 302 */
303int hpux_utssys(char *ubuf, int n, int type) 303int hpux_utssys(char __user *ubuf, int n, int type)
304{ 304{
305 int len; 305 int len;
306 int error; 306 int error;
307 switch( type ) { 307 switch( type ) {
308 case 0: 308 case 0:
309 /* uname(): */ 309 /* uname(): */
310 return( hpux_uname( (struct hpux_utsname *)ubuf ) ); 310 return hpux_uname((struct hpux_utsname __user *)ubuf);
311 break ; 311 break ;
312 case 1: 312 case 1:
313 /* Obsolete (used to be umask().) */ 313 /* Obsolete (used to be umask().) */
@@ -315,8 +315,9 @@ int hpux_utssys(char *ubuf, int n, int type)
315 break ; 315 break ;
316 case 2: 316 case 2:
317 /* ustat(): */ 317 /* ustat(): */
318 return( hpux_ustat(new_decode_dev(n), (struct hpux_ustat *)ubuf) ); 318 return hpux_ustat(new_decode_dev(n),
319 break ; 319 (struct hpux_ustat __user *)ubuf);
320 break;
320 case 3: 321 case 3:
321 /* setuname(): 322 /* setuname():
322 * 323 *
@@ -332,7 +333,7 @@ int hpux_utssys(char *ubuf, int n, int type)
332 return -EINVAL ; 333 return -EINVAL ;
333 /* Unlike Linux, HP-UX truncates it if n is too big: */ 334 /* Unlike Linux, HP-UX truncates it if n is too big: */
334 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ; 335 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
335 return( sys_sethostname(ubuf, len) ); 336 return sys_sethostname(ubuf, len);
336 break ; 337 break ;
337 case 4: 338 case 4:
338 /* sethostname(): 339 /* sethostname():
@@ -346,7 +347,7 @@ int hpux_utssys(char *ubuf, int n, int type)
346 return -EINVAL ; 347 return -EINVAL ;
347 /* Unlike Linux, HP-UX truncates it if n is too big: */ 348 /* Unlike Linux, HP-UX truncates it if n is too big: */
348 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ; 349 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
349 return( sys_sethostname(ubuf, len) ); 350 return sys_sethostname(ubuf, len);
350 break ; 351 break ;
351 case 5: 352 case 5:
352 /* gethostname(): 353 /* gethostname():
@@ -356,7 +357,7 @@ int hpux_utssys(char *ubuf, int n, int type)
356 /* Unlike Linux, HP-UX returns an error if n==0: */ 357 /* Unlike Linux, HP-UX returns an error if n==0: */
357 if ( n <= 0 ) 358 if ( n <= 0 )
358 return -EINVAL ; 359 return -EINVAL ;
359 return( sys_gethostname(ubuf, n) ); 360 return sys_gethostname(ubuf, n);
360 break ; 361 break ;
361 case 6: 362 case 6:
362 /* Supposedly called from setuname() in libc. 363 /* Supposedly called from setuname() in libc.
@@ -420,7 +421,7 @@ int hpux_utssys(char *ubuf, int n, int type)
420 } 421 }
421} 422}
422 423
423int hpux_getdomainname(char *name, int len) 424int hpux_getdomainname(char __user *name, int len)
424{ 425{
425 int nlen; 426 int nlen;
426 int err = -EFAULT; 427 int err = -EFAULT;
@@ -471,17 +472,18 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
471 printk(KERN_DEBUG "hpux_sysfs called with arg1='%lx'\n", arg1); 472 printk(KERN_DEBUG "hpux_sysfs called with arg1='%lx'\n", arg1);
472 473
473 if ( opcode == 1 ) { /* GETFSIND */ 474 if ( opcode == 1 ) { /* GETFSIND */
474 len = strlen_user((char *)arg1); 475 char __user *user_fsname = (char __user *)arg1;
476 len = strlen_user(user_fsname);
475 printk(KERN_DEBUG "len of arg1 = %d\n", len); 477 printk(KERN_DEBUG "len of arg1 = %d\n", len);
476 if (len == 0) 478 if (len == 0)
477 return 0; 479 return 0;
478 fsname = kmalloc(len, GFP_KERNEL); 480 fsname = kmalloc(len, GFP_KERNEL);
479 if ( !fsname ) { 481 if (!fsname) {
480 printk(KERN_DEBUG "failed to kmalloc fsname\n"); 482 printk(KERN_DEBUG "failed to kmalloc fsname\n");
481 return 0; 483 return 0;
482 } 484 }
483 485
484 if ( copy_from_user(fsname, (char *)arg1, len) ) { 486 if (copy_from_user(fsname, user_fsname, len)) {
485 printk(KERN_DEBUG "failed to copy_from_user fsname\n"); 487 printk(KERN_DEBUG "failed to copy_from_user fsname\n");
486 kfree(fsname); 488 kfree(fsname);
487 return 0; 489 return 0;
@@ -495,7 +497,7 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
495 fstype = 0; 497 fstype = 0;
496 } else { 498 } else {
497 fstype = 0; 499 fstype = 0;
498 }; 500 }
499 501
500 kfree(fsname); 502 kfree(fsname);
501 503