mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
ANDROID: scsi: Add segment checking in sg_read
Bug: 65023233 Signed-off-by: Roberto Pereira <rpere@google.com> Change-Id: Ib45f402cf304f9b8bf18884738f92b9c3db55573
This commit is contained in:
parent
b7f0468bb9
commit
7b53ae9e92
1 changed files with 3 additions and 0 deletions
|
@ -353,6 +353,9 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
|
|||
struct sg_header *old_hdr = NULL;
|
||||
int retval = 0;
|
||||
|
||||
if (unlikely(segment_eq(get_fs(), KERNEL_DS)))
|
||||
return -EINVAL;
|
||||
|
||||
if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
|
||||
return -ENXIO;
|
||||
SCSI_LOG_TIMEOUT(3, printk("sg_read: %s, count=%d\n",
|
||||
|
|
Loading…
Reference in a new issue