diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-14 11:37:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-14 11:37:53 -0500 |
commit | 61c39bb354a1f791ba6f562b766a72e508a036ee (patch) | |
tree | 1186cd23bc50089c8506b19403220ca46542de2c /drivers | |
parent | 4a24eef671614aea479eac6c9ce5fa2cf590ee76 (diff) | |
parent | c5406079780f0f687316732353f49c3357504428 (diff) |
Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
[S390] tape_char: add missing compat_ptr conversion
[S390] zcrypt: add sanity check before copy_from_user()
[S390] unwire sys_recvmmsg again
[S390] con3215: remove empty ioctl function
[S390] dasd: add proper compat pointer conversion for symmetrix ioctl
[S390] mmap: add missing compat_ptr conversion to both mmap compat syscalls
[S390] bug: implement arch specific __WARN macro
[S390] Move __cpu_logical_map to smp.c
[S390] tape_block: remove ioctl function
[S390] smp: remove volatile type quilifier from __cpu_logical_map
[S390] smp: setup smp_processor_id early
[S390] use helpers for rlimits
[S390] fs3270: add missing compat ptr conversion
[S390] vmcp: add missing compat ptr conversion
[S390] cio: add missing compat ptr conversion
[S390] dasd: add missing compat ptr conversion
[S390] remove superfluous TIF_USEDFPU bit
[S390] duplicate SIGTRAP on signal delivery.
[S390] clear TIF_SINGLE_STEP for new process.
[S390] fix loading of PER control registers for utrace.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/block/dasd_eckd.c | 14 | ||||
-rw-r--r-- | drivers/s390/block/dasd_ioctl.c | 14 | ||||
-rw-r--r-- | drivers/s390/char/con3215.c | 17 | ||||
-rw-r--r-- | drivers/s390/char/fs3270.c | 17 | ||||
-rw-r--r-- | drivers/s390/char/tape_block.c | 39 | ||||
-rw-r--r-- | drivers/s390/char/tape_char.c | 18 | ||||
-rw-r--r-- | drivers/s390/char/vmcp.c | 12 | ||||
-rw-r--r-- | drivers/s390/cio/chsc_sch.c | 23 | ||||
-rw-r--r-- | drivers/s390/crypto/zcrypt_api.c | 4 |
9 files changed, 71 insertions, 87 deletions
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 5819dc02a143..1c500c462225 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <asm/debug.h> | 23 | #include <asm/debug.h> |
24 | #include <asm/idals.h> | 24 | #include <asm/idals.h> |
25 | #include <asm/ebcdic.h> | 25 | #include <asm/ebcdic.h> |
26 | #include <asm/compat.h> | ||
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
27 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
28 | #include <asm/cio.h> | 29 | #include <asm/cio.h> |
@@ -2844,13 +2845,16 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp) | |||
2844 | rc = -EFAULT; | 2845 | rc = -EFAULT; |
2845 | if (copy_from_user(&usrparm, argp, sizeof(usrparm))) | 2846 | if (copy_from_user(&usrparm, argp, sizeof(usrparm))) |
2846 | goto out; | 2847 | goto out; |
2847 | #ifndef CONFIG_64BIT | 2848 | if (is_compat_task() || sizeof(long) == 4) { |
2848 | /* Make sure pointers are sane even on 31 bit. */ | 2849 | /* Make sure pointers are sane even on 31 bit. */ |
2849 | if ((usrparm.psf_data >> 32) != 0 || (usrparm.rssd_result >> 32) != 0) { | ||
2850 | rc = -EINVAL; | 2850 | rc = -EINVAL; |
2851 | goto out; | 2851 | if ((usrparm.psf_data >> 32) != 0) |
2852 | goto out; | ||
2853 | if ((usrparm.rssd_result >> 32) != 0) | ||
2854 | goto out; | ||
2855 | usrparm.psf_data &= 0x7fffffffULL; | ||
2856 | usrparm.rssd_result &= 0x7fffffffULL; | ||
2852 | } | 2857 | } |
2853 | #endif | ||
2854 | /* alloc I/O data area */ | 2858 | /* alloc I/O data area */ |
2855 | psf_data = kzalloc(usrparm.psf_data_len, GFP_KERNEL | GFP_DMA); | 2859 | psf_data = kzalloc(usrparm.psf_data_len, GFP_KERNEL | GFP_DMA); |
2856 | rssd_result = kzalloc(usrparm.rssd_result_len, GFP_KERNEL | GFP_DMA); | 2860 | rssd_result = kzalloc(usrparm.rssd_result_len, GFP_KERNEL | GFP_DMA); |
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index 478bcdb90b6f..fc7b30b4a255 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/blkpg.h> | 18 | #include <linux/blkpg.h> |
19 | #include <linux/smp_lock.h> | 19 | #include <linux/smp_lock.h> |
20 | 20 | #include <asm/compat.h> | |
21 | #include <asm/ccwdev.h> | 21 | #include <asm/ccwdev.h> |
22 | #include <asm/cmb.h> | 22 | #include <asm/cmb.h> |
23 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
@@ -358,9 +358,8 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp) | |||
358 | } | 358 | } |
359 | 359 | ||
360 | static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, | 360 | static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, |
361 | unsigned long arg) | 361 | struct cmbdata __user *argp) |
362 | { | 362 | { |
363 | struct cmbdata __user *argp = (void __user *) arg; | ||
364 | size_t size = _IOC_SIZE(cmd); | 363 | size_t size = _IOC_SIZE(cmd); |
365 | struct cmbdata data; | 364 | struct cmbdata data; |
366 | int ret; | 365 | int ret; |
@@ -376,7 +375,12 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode, | |||
376 | unsigned int cmd, unsigned long arg) | 375 | unsigned int cmd, unsigned long arg) |
377 | { | 376 | { |
378 | struct dasd_block *block = bdev->bd_disk->private_data; | 377 | struct dasd_block *block = bdev->bd_disk->private_data; |
379 | void __user *argp = (void __user *)arg; | 378 | void __user *argp; |
379 | |||
380 | if (is_compat_task()) | ||
381 | argp = compat_ptr(arg); | ||
382 | else | ||
383 | argp = (void __user *)arg; | ||
380 | 384 | ||
381 | if (!block) | 385 | if (!block) |
382 | return -ENODEV; | 386 | return -ENODEV; |
@@ -414,7 +418,7 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode, | |||
414 | case BIODASDCMFDISABLE: | 418 | case BIODASDCMFDISABLE: |
415 | return disable_cmf(block->base->cdev); | 419 | return disable_cmf(block->base->cdev); |
416 | case BIODASDREADALLCMB: | 420 | case BIODASDREADALLCMB: |
417 | return dasd_ioctl_readall_cmb(block, cmd, arg); | 421 | return dasd_ioctl_readall_cmb(block, cmd, argp); |
418 | default: | 422 | default: |
419 | /* if the discipline has an ioctl method try it. */ | 423 | /* if the discipline has an ioctl method try it. */ |
420 | if (block->base->discipline->ioctl) { | 424 | if (block->base->discipline->ioctl) { |
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 9d61683b5633..59ec073724bf 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
@@ -1037,22 +1037,6 @@ static void tty3215_flush_buffer(struct tty_struct *tty) | |||
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | /* | 1039 | /* |
1040 | * Currently we don't have any io controls for 3215 ttys | ||
1041 | */ | ||
1042 | static int tty3215_ioctl(struct tty_struct *tty, struct file * file, | ||
1043 | unsigned int cmd, unsigned long arg) | ||
1044 | { | ||
1045 | if (tty->flags & (1 << TTY_IO_ERROR)) | ||
1046 | return -EIO; | ||
1047 | |||
1048 | switch (cmd) { | ||
1049 | default: | ||
1050 | return -ENOIOCTLCMD; | ||
1051 | } | ||
1052 | return 0; | ||
1053 | } | ||
1054 | |||
1055 | /* | ||
1056 | * Disable reading from a 3215 tty | 1040 | * Disable reading from a 3215 tty |
1057 | */ | 1041 | */ |
1058 | static void tty3215_throttle(struct tty_struct * tty) | 1042 | static void tty3215_throttle(struct tty_struct * tty) |
@@ -1117,7 +1101,6 @@ static const struct tty_operations tty3215_ops = { | |||
1117 | .write_room = tty3215_write_room, | 1101 | .write_room = tty3215_write_room, |
1118 | .chars_in_buffer = tty3215_chars_in_buffer, | 1102 | .chars_in_buffer = tty3215_chars_in_buffer, |
1119 | .flush_buffer = tty3215_flush_buffer, | 1103 | .flush_buffer = tty3215_flush_buffer, |
1120 | .ioctl = tty3215_ioctl, | ||
1121 | .throttle = tty3215_throttle, | 1104 | .throttle = tty3215_throttle, |
1122 | .unthrottle = tty3215_unthrottle, | 1105 | .unthrottle = tty3215_unthrottle, |
1123 | .stop = tty3215_stop, | 1106 | .stop = tty3215_stop, |
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index 247b2b934728..31c59b0d6df0 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/smp_lock.h> | 16 | #include <linux/smp_lock.h> |
17 | 17 | ||
18 | #include <asm/compat.h> | ||
18 | #include <asm/ccwdev.h> | 19 | #include <asm/ccwdev.h> |
19 | #include <asm/cio.h> | 20 | #include <asm/cio.h> |
20 | #include <asm/ebcdic.h> | 21 | #include <asm/ebcdic.h> |
@@ -322,6 +323,7 @@ fs3270_write(struct file *filp, const char __user *data, size_t count, loff_t *o | |||
322 | static long | 323 | static long |
323 | fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 324 | fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
324 | { | 325 | { |
326 | char __user *argp; | ||
325 | struct fs3270 *fp; | 327 | struct fs3270 *fp; |
326 | struct raw3270_iocb iocb; | 328 | struct raw3270_iocb iocb; |
327 | int rc; | 329 | int rc; |
@@ -329,6 +331,10 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
329 | fp = filp->private_data; | 331 | fp = filp->private_data; |
330 | if (!fp) | 332 | if (!fp) |
331 | return -ENODEV; | 333 | return -ENODEV; |
334 | if (is_compat_task()) | ||
335 | argp = compat_ptr(arg); | ||
336 | else | ||
337 | argp = (char __user *)arg; | ||
332 | rc = 0; | 338 | rc = 0; |
333 | mutex_lock(&fs3270_mutex); | 339 | mutex_lock(&fs3270_mutex); |
334 | switch (cmd) { | 340 | switch (cmd) { |
@@ -339,10 +345,10 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
339 | fp->write_command = arg; | 345 | fp->write_command = arg; |
340 | break; | 346 | break; |
341 | case TUBGETI: | 347 | case TUBGETI: |
342 | rc = put_user(fp->read_command, (char __user *) arg); | 348 | rc = put_user(fp->read_command, argp); |
343 | break; | 349 | break; |
344 | case TUBGETO: | 350 | case TUBGETO: |
345 | rc = put_user(fp->write_command,(char __user *) arg); | 351 | rc = put_user(fp->write_command, argp); |
346 | break; | 352 | break; |
347 | case TUBGETMOD: | 353 | case TUBGETMOD: |
348 | iocb.model = fp->view.model; | 354 | iocb.model = fp->view.model; |
@@ -351,8 +357,7 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
351 | iocb.pf_cnt = 24; | 357 | iocb.pf_cnt = 24; |
352 | iocb.re_cnt = 20; | 358 | iocb.re_cnt = 20; |
353 | iocb.map = 0; | 359 | iocb.map = 0; |
354 | if (copy_to_user((char __user *) arg, &iocb, | 360 | if (copy_to_user(argp, &iocb, sizeof(struct raw3270_iocb))) |
355 | sizeof(struct raw3270_iocb))) | ||
356 | rc = -EFAULT; | 361 | rc = -EFAULT; |
357 | break; | 362 | break; |
358 | } | 363 | } |
@@ -511,8 +516,8 @@ static const struct file_operations fs3270_fops = { | |||
511 | .write = fs3270_write, /* write */ | 516 | .write = fs3270_write, /* write */ |
512 | .unlocked_ioctl = fs3270_ioctl, /* ioctl */ | 517 | .unlocked_ioctl = fs3270_ioctl, /* ioctl */ |
513 | .compat_ioctl = fs3270_ioctl, /* ioctl */ | 518 | .compat_ioctl = fs3270_ioctl, /* ioctl */ |
514 | .open = fs3270_open, /* open */ | 519 | .open = fs3270_open, /* open */ |
515 | .release = fs3270_close, /* release */ | 520 | .release = fs3270_close, /* release */ |
516 | }; | 521 | }; |
517 | 522 | ||
518 | /* | 523 | /* |
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index 96816149368a..8d3d720737da 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
@@ -46,8 +46,6 @@ | |||
46 | */ | 46 | */ |
47 | static int tapeblock_open(struct block_device *, fmode_t); | 47 | static int tapeblock_open(struct block_device *, fmode_t); |
48 | static int tapeblock_release(struct gendisk *, fmode_t); | 48 | static int tapeblock_release(struct gendisk *, fmode_t); |
49 | static int tapeblock_ioctl(struct block_device *, fmode_t, unsigned int, | ||
50 | unsigned long); | ||
51 | static int tapeblock_medium_changed(struct gendisk *); | 49 | static int tapeblock_medium_changed(struct gendisk *); |
52 | static int tapeblock_revalidate_disk(struct gendisk *); | 50 | static int tapeblock_revalidate_disk(struct gendisk *); |
53 | 51 | ||
@@ -55,7 +53,6 @@ static const struct block_device_operations tapeblock_fops = { | |||
55 | .owner = THIS_MODULE, | 53 | .owner = THIS_MODULE, |
56 | .open = tapeblock_open, | 54 | .open = tapeblock_open, |
57 | .release = tapeblock_release, | 55 | .release = tapeblock_release, |
58 | .ioctl = tapeblock_ioctl, | ||
59 | .media_changed = tapeblock_medium_changed, | 56 | .media_changed = tapeblock_medium_changed, |
60 | .revalidate_disk = tapeblock_revalidate_disk, | 57 | .revalidate_disk = tapeblock_revalidate_disk, |
61 | }; | 58 | }; |
@@ -416,42 +413,6 @@ tapeblock_release(struct gendisk *disk, fmode_t mode) | |||
416 | } | 413 | } |
417 | 414 | ||
418 | /* | 415 | /* |
419 | * Support of some generic block device IOCTLs. | ||
420 | */ | ||
421 | static int | ||
422 | tapeblock_ioctl( | ||
423 | struct block_device * bdev, | ||
424 | fmode_t mode, | ||
425 | unsigned int command, | ||
426 | unsigned long arg | ||
427 | ) { | ||
428 | int rc; | ||
429 | int minor; | ||
430 | struct gendisk *disk = bdev->bd_disk; | ||
431 | struct tape_device *device; | ||
432 | |||
433 | rc = 0; | ||
434 | BUG_ON(!disk); | ||
435 | device = disk->private_data; | ||
436 | BUG_ON(!device); | ||
437 | minor = MINOR(bdev->bd_dev); | ||
438 | |||
439 | DBF_LH(6, "tapeblock_ioctl(0x%0x)\n", command); | ||
440 | DBF_LH(6, "device = %d:%d\n", tapeblock_major, minor); | ||
441 | |||
442 | switch (command) { | ||
443 | /* Refuse some IOCTL calls without complaining (mount). */ | ||
444 | case 0x5310: /* CDROMMULTISESSION */ | ||
445 | rc = -EINVAL; | ||
446 | break; | ||
447 | default: | ||
448 | rc = -EINVAL; | ||
449 | } | ||
450 | |||
451 | return rc; | ||
452 | } | ||
453 | |||
454 | /* | ||
455 | * Initialize block device frontend. | 416 | * Initialize block device frontend. |
456 | */ | 417 | */ |
457 | int | 418 | int |
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index 2125ec7d95f0..539045acaad4 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/proc_fs.h> | 18 | #include <linux/proc_fs.h> |
19 | #include <linux/mtio.h> | 19 | #include <linux/mtio.h> |
20 | #include <linux/smp_lock.h> | 20 | #include <linux/smp_lock.h> |
21 | #include <linux/compat.h> | ||
21 | 22 | ||
22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
23 | 24 | ||
@@ -37,8 +38,9 @@ static ssize_t tapechar_write(struct file *, const char __user *, size_t, loff_t | |||
37 | static int tapechar_open(struct inode *,struct file *); | 38 | static int tapechar_open(struct inode *,struct file *); |
38 | static int tapechar_release(struct inode *,struct file *); | 39 | static int tapechar_release(struct inode *,struct file *); |
39 | static long tapechar_ioctl(struct file *, unsigned int, unsigned long); | 40 | static long tapechar_ioctl(struct file *, unsigned int, unsigned long); |
40 | static long tapechar_compat_ioctl(struct file *, unsigned int, | 41 | #ifdef CONFIG_COMPAT |
41 | unsigned long); | 42 | static long tapechar_compat_ioctl(struct file *, unsigned int, unsigned long); |
43 | #endif | ||
42 | 44 | ||
43 | static const struct file_operations tape_fops = | 45 | static const struct file_operations tape_fops = |
44 | { | 46 | { |
@@ -46,7 +48,9 @@ static const struct file_operations tape_fops = | |||
46 | .read = tapechar_read, | 48 | .read = tapechar_read, |
47 | .write = tapechar_write, | 49 | .write = tapechar_write, |
48 | .unlocked_ioctl = tapechar_ioctl, | 50 | .unlocked_ioctl = tapechar_ioctl, |
51 | #ifdef CONFIG_COMPAT | ||
49 | .compat_ioctl = tapechar_compat_ioctl, | 52 | .compat_ioctl = tapechar_compat_ioctl, |
53 | #endif | ||
50 | .open = tapechar_open, | 54 | .open = tapechar_open, |
51 | .release = tapechar_release, | 55 | .release = tapechar_release, |
52 | }; | 56 | }; |
@@ -457,15 +461,22 @@ tapechar_ioctl(struct file *filp, unsigned int no, unsigned long data) | |||
457 | return rc; | 461 | return rc; |
458 | } | 462 | } |
459 | 463 | ||
464 | #ifdef CONFIG_COMPAT | ||
460 | static long | 465 | static long |
461 | tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) | 466 | tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) |
462 | { | 467 | { |
463 | struct tape_device *device = filp->private_data; | 468 | struct tape_device *device = filp->private_data; |
464 | int rval = -ENOIOCTLCMD; | 469 | int rval = -ENOIOCTLCMD; |
470 | unsigned long argp; | ||
465 | 471 | ||
472 | /* The 'arg' argument of any ioctl function may only be used for | ||
473 | * pointers because of the compat pointer conversion. | ||
474 | * Consider this when adding new ioctls. | ||
475 | */ | ||
476 | argp = (unsigned long) compat_ptr(data); | ||
466 | if (device->discipline->ioctl_fn) { | 477 | if (device->discipline->ioctl_fn) { |
467 | mutex_lock(&device->mutex); | 478 | mutex_lock(&device->mutex); |
468 | rval = device->discipline->ioctl_fn(device, no, data); | 479 | rval = device->discipline->ioctl_fn(device, no, argp); |
469 | mutex_unlock(&device->mutex); | 480 | mutex_unlock(&device->mutex); |
470 | if (rval == -EINVAL) | 481 | if (rval == -EINVAL) |
471 | rval = -ENOIOCTLCMD; | 482 | rval = -ENOIOCTLCMD; |
@@ -473,6 +484,7 @@ tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) | |||
473 | 484 | ||
474 | return rval; | 485 | return rval; |
475 | } | 486 | } |
487 | #endif /* CONFIG_COMPAT */ | ||
476 | 488 | ||
477 | /* | 489 | /* |
478 | * Initialize character device frontend. | 490 | * Initialize character device frontend. |
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c index a6087cec55b4..921dcda77676 100644 --- a/drivers/s390/char/vmcp.c +++ b/drivers/s390/char/vmcp.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/miscdevice.h> | 20 | #include <linux/miscdevice.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <asm/compat.h> | ||
22 | #include <asm/cpcmd.h> | 23 | #include <asm/cpcmd.h> |
23 | #include <asm/debug.h> | 24 | #include <asm/debug.h> |
24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
@@ -139,21 +140,26 @@ vmcp_write(struct file *file, const char __user *buff, size_t count, | |||
139 | static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 140 | static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
140 | { | 141 | { |
141 | struct vmcp_session *session; | 142 | struct vmcp_session *session; |
143 | int __user *argp; | ||
142 | int temp; | 144 | int temp; |
143 | 145 | ||
144 | session = (struct vmcp_session *)file->private_data; | 146 | session = (struct vmcp_session *)file->private_data; |
147 | if (is_compat_task()) | ||
148 | argp = compat_ptr(arg); | ||
149 | else | ||
150 | argp = (int __user *)arg; | ||
145 | if (mutex_lock_interruptible(&session->mutex)) | 151 | if (mutex_lock_interruptible(&session->mutex)) |
146 | return -ERESTARTSYS; | 152 | return -ERESTARTSYS; |
147 | switch (cmd) { | 153 | switch (cmd) { |
148 | case VMCP_GETCODE: | 154 | case VMCP_GETCODE: |
149 | temp = session->resp_code; | 155 | temp = session->resp_code; |
150 | mutex_unlock(&session->mutex); | 156 | mutex_unlock(&session->mutex); |
151 | return put_user(temp, (int __user *)arg); | 157 | return put_user(temp, argp); |
152 | case VMCP_SETBUF: | 158 | case VMCP_SETBUF: |
153 | free_pages((unsigned long)session->response, | 159 | free_pages((unsigned long)session->response, |
154 | get_order(session->bufsize)); | 160 | get_order(session->bufsize)); |
155 | session->response=NULL; | 161 | session->response=NULL; |
156 | temp = get_user(session->bufsize, (int __user *)arg); | 162 | temp = get_user(session->bufsize, argp); |
157 | if (get_order(session->bufsize) > 8) { | 163 | if (get_order(session->bufsize) > 8) { |
158 | session->bufsize = PAGE_SIZE; | 164 | session->bufsize = PAGE_SIZE; |
159 | temp = -EINVAL; | 165 | temp = -EINVAL; |
@@ -163,7 +169,7 @@ static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
163 | case VMCP_GETSIZE: | 169 | case VMCP_GETSIZE: |
164 | temp = session->resp_size; | 170 | temp = session->resp_size; |
165 | mutex_unlock(&session->mutex); | 171 | mutex_unlock(&session->mutex); |
166 | return put_user(temp, (int __user *)arg); | 172 | return put_user(temp, argp); |
167 | default: | 173 | default: |
168 | mutex_unlock(&session->mutex); | 174 | mutex_unlock(&session->mutex); |
169 | return -ENOIOCTLCMD; | 175 | return -ENOIOCTLCMD; |
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c index cc5144b6f9d9..c84ac9443079 100644 --- a/drivers/s390/cio/chsc_sch.c +++ b/drivers/s390/cio/chsc_sch.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/uaccess.h> | 12 | #include <linux/uaccess.h> |
13 | #include <linux/miscdevice.h> | 13 | #include <linux/miscdevice.h> |
14 | 14 | ||
15 | #include <asm/compat.h> | ||
15 | #include <asm/cio.h> | 16 | #include <asm/cio.h> |
16 | #include <asm/chsc.h> | 17 | #include <asm/chsc.h> |
17 | #include <asm/isc.h> | 18 | #include <asm/isc.h> |
@@ -770,24 +771,30 @@ out_free: | |||
770 | static long chsc_ioctl(struct file *filp, unsigned int cmd, | 771 | static long chsc_ioctl(struct file *filp, unsigned int cmd, |
771 | unsigned long arg) | 772 | unsigned long arg) |
772 | { | 773 | { |
774 | void __user *argp; | ||
775 | |||
773 | CHSC_MSG(2, "chsc_ioctl called, cmd=%x\n", cmd); | 776 | CHSC_MSG(2, "chsc_ioctl called, cmd=%x\n", cmd); |
777 | if (is_compat_task()) | ||
778 | argp = compat_ptr(arg); | ||
779 | else | ||
780 | argp = (void __user *)arg; | ||
774 | switch (cmd) { | 781 | switch (cmd) { |
775 | case CHSC_START: | 782 | case CHSC_START: |
776 | return chsc_ioctl_start((void __user *)arg); | 783 | return chsc_ioctl_start(argp); |
777 | case CHSC_INFO_CHANNEL_PATH: | 784 | case CHSC_INFO_CHANNEL_PATH: |
778 | return chsc_ioctl_info_channel_path((void __user *)arg); | 785 | return chsc_ioctl_info_channel_path(argp); |
779 | case CHSC_INFO_CU: | 786 | case CHSC_INFO_CU: |
780 | return chsc_ioctl_info_cu((void __user *)arg); | 787 | return chsc_ioctl_info_cu(argp); |
781 | case CHSC_INFO_SCH_CU: | 788 | case CHSC_INFO_SCH_CU: |
782 | return chsc_ioctl_info_sch_cu((void __user *)arg); | 789 | return chsc_ioctl_info_sch_cu(argp); |
783 | case CHSC_INFO_CI: | 790 | case CHSC_INFO_CI: |
784 | return chsc_ioctl_conf_info((void __user *)arg); | 791 | return chsc_ioctl_conf_info(argp); |
785 | case CHSC_INFO_CCL: | 792 | case CHSC_INFO_CCL: |
786 | return chsc_ioctl_conf_comp_list((void __user *)arg); | 793 | return chsc_ioctl_conf_comp_list(argp); |
787 | case CHSC_INFO_CPD: | 794 | case CHSC_INFO_CPD: |
788 | return chsc_ioctl_chpd((void __user *)arg); | 795 | return chsc_ioctl_chpd(argp); |
789 | case CHSC_INFO_DCAL: | 796 | case CHSC_INFO_DCAL: |
790 | return chsc_ioctl_dcal((void __user *)arg); | 797 | return chsc_ioctl_dcal(argp); |
791 | default: /* unknown ioctl number */ | 798 | default: /* unknown ioctl number */ |
792 | return -ENOIOCTLCMD; | 799 | return -ENOIOCTLCMD; |
793 | } | 800 | } |
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 0d4d18bdd45c..c68be24e27d9 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c | |||
@@ -393,10 +393,12 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt) | |||
393 | * u_mult_inv > 128 bytes. | 393 | * u_mult_inv > 128 bytes. |
394 | */ | 394 | */ |
395 | if (copied == 0) { | 395 | if (copied == 0) { |
396 | int len; | 396 | unsigned int len; |
397 | spin_unlock_bh(&zcrypt_device_lock); | 397 | spin_unlock_bh(&zcrypt_device_lock); |
398 | /* len is max 256 / 2 - 120 = 8 */ | 398 | /* len is max 256 / 2 - 120 = 8 */ |
399 | len = crt->inputdatalength / 2 - 120; | 399 | len = crt->inputdatalength / 2 - 120; |
400 | if (len > sizeof(z1)) | ||
401 | return -EFAULT; | ||
400 | z1 = z2 = z3 = 0; | 402 | z1 = z2 = z3 = 0; |
401 | if (copy_from_user(&z1, crt->np_prime, len) || | 403 | if (copy_from_user(&z1, crt->np_prime, len) || |
402 | copy_from_user(&z2, crt->bp_key, len) || | 404 | copy_from_user(&z2, crt->bp_key, len) || |