Skip to contentSkip to conversation

scsi: hpsa: fix information leak to userland

PATCH In review Vasiliy Kulikov 2 participants 2 messages Oct 27, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: hpsa: fix information leak to userland

Structure IOCTL_Command_struct is copied to userland with some padding fields at the end of the struct unitialized. It leads to leaking of contents of kernel stack memory.

---
Compile tested.

 drivers/scsi/hpsa.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/scsi/hpsa.c +2 -0
index c5d0606..641a38c 100644
@@ -2298,6 +2298,7 @@ static int hpsa_ioctl32_passthru(struct scsi_device *dev, int cmd, void *arg)
 	int err;
 	u32 cp;
 
+	memset(&arg64, 0, sizeof(arg64));
 	err = 0;
 	err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
 			   sizeof(arg64.LUN_info));
@@ -2334,6 +2335,7 @@ static int hpsa_ioctl32_big_passthru(struct scsi_device *dev,
 	int err;
 	u32 cp;
 
+	memset(&arg64, 0, sizeof(arg64));
 	err = 0;
 	err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
 			   sizeof(arg64.LUN_info));
Signature · 1 line
1.7.0.4
Acked-by on v1 1/1
#1 lore raw
Quoted 43 lines

-----Original Message-----
From: Vasiliy Kulikov [mailto:[email protected]]
Sent: Wednesday, October 27, 2010 10:41 AM
To: [email protected]
Cc: Stephen M. Cameron; James E.J. Bottomley; Miller, Mike (OS Dev); ISS StorageDev; [email protected]; linux- [email protected]
Subject: [PATCH] scsi: hpsa: fix information leak to userland

Structure IOCTL_Command_struct is copied to userland with some padding fields at the end of the struct unitialized. It leads to leaking of contents of kernel stack memory.

---
Compile tested.

 drivers/scsi/hpsa.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/scsi/hpsa.c +1 -0
index c5d0606..641a38c 100644
@@ -2298,6 +2298,7 @@ static int hpsa_ioctl32_passthru(struct
 scsi_device *dev, int cmd, void *arg)
 	int err;
 	u32 cp;
 
+	memset(&arg64, 0, sizeof(arg64));
 	err = 0;
 	err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
drivers/scsi/hpsa.c +1 -0
 			   sizeof(arg64.LUN_info));
@@ -2334,6 +2335,7 @@ static int hpsa_ioctl32_big_passthru(struct
 scsi_device *dev,
 	int err;
 	u32 cp;
 
+	memset(&arg64, 0, sizeof(arg64));
 	err = 0;
 	err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
Quoted 3 lines

sizeof(arg64.LUN_info));
--
1.7.0.4