aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorVasiliy Kulikov <segooon@gmail.com>2011-01-07 11:55:53 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-01-24 12:34:05 -0500
commit938abd8449c27fc67203e1a7c350199cea1158da (patch)
tree9df0d8a955d7c874010db02bcefa59e73ff941aa /drivers/scsi/hpsa.c
parent1d5e2ed0805bf426226b7daa54b3e60af78baa10 (diff)
[SCSI] hpsa: avoid leaking stack contents to userland
memset arg64 to zero in the passthrough ioctls to avoid leaking contents of kernel stack memory to userland via uninitialized padding fields inserted by the compiler for alignment reasons. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 5828bcb82964..959eeb202d92 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -2310,6 +2310,7 @@ static int hpsa_ioctl32_passthru(struct scsi_device *dev, int cmd, void *arg)
2310 int err; 2310 int err;
2311 u32 cp; 2311 u32 cp;
2312 2312
2313 memset(&arg64, 0, sizeof(arg64));
2313 err = 0; 2314 err = 0;
2314 err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, 2315 err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
2315 sizeof(arg64.LUN_info)); 2316 sizeof(arg64.LUN_info));
@@ -2346,6 +2347,7 @@ static int hpsa_ioctl32_big_passthru(struct scsi_device *dev,
2346 int err; 2347 int err;
2347 u32 cp; 2348 u32 cp;
2348 2349
2350 memset(&arg64, 0, sizeof(arg64));
2349 err = 0; 2351 err = 0;
2350 err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, 2352 err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
2351 sizeof(arg64.LUN_info)); 2353 sizeof(arg64.LUN_info));