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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <367BED6D-3187-473C-BBF4-EB71A0E1677A@kolumbus.fi>
Date: Tue, 25 Feb 2025 11:43:06 +0200
From: "Kai Mäkisara (Kolumbus)" <kai.makisara@...umbus.fi>
To: Arnd Bergmann <arnd@...nel.org>
Cc: "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
 "Martin K. Petersen" <martin.petersen@...cle.com>,
 John Meneghini <jmeneghi@...hat.com>,
 Arnd Bergmann <arnd@...db.de>,
 Bart Van Assche <bvanassche@....org>,
 John Garry <john.g.garry@...cle.com>,
 linux-scsi@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: scsi_debug: fix uninitialized variable use


> On 25. Feb 2025, at 10.56, Arnd Bergmann <arnd@...nel.org> wrote:
> 
> From: Arnd Bergmann <arnd@...db.de>
> 
> It appears that a typo has made it into the newly added code
> 
> drivers/scsi/scsi_debug.c:3035:3: error: variable 'len' is uninitialized when used here [-Werror,-Wuninitialized]
> 3035 |                 len += resp_compression_m_pg(ap, pcontrol, target, devip->tape_dce);
>      |                 ^~~
> 
> Replace the '+=' with the intended '=' here.

One more of these ;) The fix is correct. (And now I checked with grep that v2 does not have any more of these.)

> 
> Fixes: e7795366c41d ("scsi: scsi_debug: Add READ BLOCK LIMITS and modify LOAD for tapes")

The bug was actually in 568354b24c7d "scsi: scsi_debug: Add compression mode page for tapes"

> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Acked-by: Kai Mäkisara <kai.makisara@...umbus.fi <mailto:kai.makisara@...umbus.fi>>

> ---
> drivers/scsi/scsi_debug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
> index 722ee8c067ae..f3e9a63bbf02 100644
> --- a/drivers/scsi/scsi_debug.c
> +++ b/drivers/scsi/scsi_debug.c
> @@ -3032,7 +3032,7 @@ static int resp_mode_sense(struct scsi_cmnd *scp,
> case 0xf: /* Compression Mode Page (tape) */
> if (!is_tape)
> goto bad_pcode;
> - len += resp_compression_m_pg(ap, pcontrol, target, devip->tape_dce);
> + len = resp_compression_m_pg(ap, pcontrol, target, devip->tape_dce);
> offset += len;
> break;
> case 0x11: /* Partition Mode Page (tape) */
> -- 
> 2.39.5
> 
> 

Thanks,
Kai


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ