Commit bae5f6c3 authored by Mike Miller's avatar Mike Miller Committed by Linus Torvalds

[PATCH] cciss: zero out buffer in passthru ioctls for HP utilities

This patch addresses a problem with our utilities.  We must zero out the
buffer before copying their data into it to prevent bogus info when switching
between SCSI & SATA or SAS drives.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 341da4ab
...@@ -866,6 +866,8 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, ...@@ -866,6 +866,8 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
kfree(buff); kfree(buff);
return -EFAULT; return -EFAULT;
} }
} else {
memset(buff, 0, iocommand.buf_size);
} }
if ((c = cmd_alloc(host , 0)) == NULL) if ((c = cmd_alloc(host , 0)) == NULL)
{ {
...@@ -1012,6 +1014,8 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, ...@@ -1012,6 +1014,8 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
copy_from_user(buff[sg_used], data_ptr, sz)) { copy_from_user(buff[sg_used], data_ptr, sz)) {
status = -ENOMEM; status = -ENOMEM;
goto cleanup1; goto cleanup1;
} else {
memset(buff[sg_used], 0, sz);
} }
left -= sz; left -= sz;
data_ptr += sz; data_ptr += sz;
......
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