scsi: hpsa: fix information leak to userland
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
@@ -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
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 userlandStructure
IOCTL_Command_structis copied to userland with some padding fields at the end of the struct unitialized. It leads to leaking of contents of kernel stack memory.Signed-off-by Vasiliy Kulikov <[email protected]>---
Compile tested.drivers/scsi/hpsa.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)drivers/scsi/hpsa.c +1
-0@@ -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
-0sizeof(arg64.LUN_info));@@ -2334,6 +2335,7 @@ static int hpsa_ioctl32_big_passthru(structscsi_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