]> git.hungrycats.org Git - linux/commitdiff
[PATCH] cciss: zero out buffer in passthru ioctls for HP utilities
authorMike Miller <mike.miller@hp.com>
Mon, 23 Aug 2004 06:07:33 +0000 (23:07 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 23 Aug 2004 06:07:33 +0000 (23:07 -0700)
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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/block/cciss.c

index ed923aa3cc07861235db5f7f5bcd0e26e72181d9..f45f55905747d95ed887fab0dc757ebc8d3d37ee 100644 (file)
@@ -866,6 +866,8 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
                                kfree(buff);
                                return -EFAULT;
                        }
+               } else {
+                       memset(buff, 0, iocommand.buf_size);
                }
                if ((c = cmd_alloc(host , 0)) == NULL)
                {
@@ -1012,6 +1014,8 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
                                copy_from_user(buff[sg_used], data_ptr, sz)) {
                                        status = -ENOMEM;
                                        goto cleanup1;                  
+                       } else {
+                               memset(buff[sg_used], 0, sz);
                        }
                        left -= sz;
                        data_ptr += sz;