lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2ik7x74hq6exam5ab4v2moauy4lfvqe3r626bxxettseat2nmv@q4gykxnezkff>
Date: Fri, 9 Feb 2024 07:24:13 +0100
From: Daniel Wagner <dwagner@...e.de>
To: Fedor Pchelkin <pchelkin@...ras.ru>
Cc: James Smart <james.smart@...adcom.com>, 
	"Martin K. Petersen" <martin.petersen@...cle.com>, Ram Vegesna <ram.vegesna@...adcom.com>, 
	"James E.J. Bottomley" <jejb@...ux.ibm.com>, Hannes Reinecke <hare@...e.de>, linux-scsi@...r.kernel.org, 
	target-devel@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Alexey Khoroshilov <khoroshilov@...ras.ru>, lvc-project@...uxtesting.org, stable@...r.kernel.org
Subject: Re: [PATCH] scsi: elx: efct: adjust error handling inside
 efct_hw_setup_io

On Thu, Feb 08, 2024 at 12:36:57PM +0300, Fedor Pchelkin wrote:
> IO and WQE buffers are allocated once per HW and can be reused later. If
> WQE buffers allocation fails then the whole allocation is marked as failed
> but already created IO array internal objects are not freed. hw->io is
> freed but not nullified in that specific case - it may become a problem
> later as efct_hw_setup_io() is supposed to be reusable for the same HW.
> 
> While at it, use kcalloc instead of kmalloc_array/memset-zero combination
> and get rid of some needless NULL assignments: nullifying hw->io[i]
> elements just before freeing hw->io is not really useful.
> 
> Found by Linux Verification Center (linuxtesting.org).
> 
> Fixes: 4df84e846624 ("scsi: elx: efct: Driver initialization routines")
> Cc: stable@...r.kernel.org
> Signed-off-by: Fedor Pchelkin <pchelkin@...ras.ru>

The patch looks okay. Though I think this funktion leaks all over the
place memory as soon we take the error path. Could you also prepare
a fix for these path while you are at it?

Thanks!
Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ