[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SJ2PR11MB836938BF289336E5CFC6FFE0E11CA@SJ2PR11MB8369.namprd11.prod.outlook.com>
Date: Wed, 24 Sep 2025 13:43:55 +0000
From: <Don.Brace@...rochip.com>
To: <thorsten.blum@...ux.dev>, <James.Bottomley@...senPartnership.com>,
<martin.petersen@...cle.com>, <mikem@...rdog.cce.hp.com>,
<James.Bottomley@...e.de>, <akpm@...ux-foundation.org>, <achiang@...com>,
<scameron@...rdog.cce.hp.com>
CC: <stable@...r.kernel.org>, <storagedev@...rochip.com>,
<linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND] scsi: hpsa: Fix potential memory leak in
hpsa_big_passthru_ioctl()
________________________________________
From: Thorsten Blum <thorsten.blum@...ux.dev>
Sent: Friday, September 19, 2025 4:26 AM
To: Don Brace - C33706 <Don.Brace@...rochip.com>; James E.J. Bottomley <James.Bottomley@...senPartnership.com>; Martin K. Petersen <martin.petersen@...cle.com>; Mike Miller <mikem@...rdog.cce.hp.com>; James Bottomley <James.Bottomley@...e.de>; Andrew Morton <akpm@...ux-foundation.org>; Alex Chiang <achiang@...com>; Stephen M. Cameron <scameron@...rdog.cce.hp.com>
Cc: Thorsten Blum <thorsten.blum@...ux.dev>; stable@...r.kernel.org <stable@...r.kernel.org>; storagedev <storagedev@...rochip.com>; linux-scsi@...r.kernel.org <linux-scsi@...r.kernel.org>; linux-kernel@...r.kernel.org <linux-kernel@...r.kernel.org>
Subject: [PATCH RESEND] scsi: hpsa: Fix potential memory leak in hpsa_big_passthru_ioctl()
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Replace kmalloc() followed by copy_from_user() with memdup_user() to fix
a memory leak that occurs when copy_from_user(buff[sg_used],,) fails and
the 'cleanup1:' path does not free the memory for 'buff[sg_used]'. Using
memdup_user() avoids this by freeing the memory internally.
Since memdup_user() already allocates memory, use kzalloc() in the else
branch instead of manually zeroing 'buff[sg_used]' using memset(0).
Cc: stable@...r.kernel.org
Fixes: edd163687ea5 ("[SCSI] hpsa: add driver for HP Smart Array controllers.")
Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
Acked-By: Don Brace <don.brace@...rochip.com>
Thanks for your patch.
Powered by blists - more mailing lists