Commit f8b06859 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

[S390] dasd: add proper compat pointer conversion for symmetrix ioctl

Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent d3815898
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <asm/debug.h> #include <asm/debug.h>
#include <asm/idals.h> #include <asm/idals.h>
#include <asm/ebcdic.h> #include <asm/ebcdic.h>
#include <asm/compat.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/cio.h> #include <asm/cio.h>
...@@ -2844,13 +2845,16 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp) ...@@ -2844,13 +2845,16 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp)
rc = -EFAULT; rc = -EFAULT;
if (copy_from_user(&usrparm, argp, sizeof(usrparm))) if (copy_from_user(&usrparm, argp, sizeof(usrparm)))
goto out; goto out;
#ifndef CONFIG_64BIT if (is_compat_task() || sizeof(long) == 4) {
/* Make sure pointers are sane even on 31 bit. */ /* Make sure pointers are sane even on 31 bit. */
if ((usrparm.psf_data >> 32) != 0 || (usrparm.rssd_result >> 32) != 0) {
rc = -EINVAL; rc = -EINVAL;
if ((usrparm.psf_data >> 32) != 0)
goto out; goto out;
if ((usrparm.rssd_result >> 32) != 0)
goto out;
usrparm.psf_data &= 0x7fffffffULL;
usrparm.rssd_result &= 0x7fffffffULL;
} }
#endif
/* alloc I/O data area */ /* alloc I/O data area */
psf_data = kzalloc(usrparm.psf_data_len, GFP_KERNEL | GFP_DMA); psf_data = kzalloc(usrparm.psf_data_len, GFP_KERNEL | GFP_DMA);
rssd_result = kzalloc(usrparm.rssd_result_len, GFP_KERNEL | GFP_DMA); rssd_result = kzalloc(usrparm.rssd_result_len, GFP_KERNEL | GFP_DMA);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment