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] [day] [month] [year] [list]
Message-ID: <bd27804e-b7bc-4693-90ac-363591ac9467@acm.org>
Date: Tue, 9 Jul 2024 10:59:52 -0700
From: Bart Van Assche <bvanassche@....org>
To: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
 James.Bottomley@...senPartnership.com
Cc: martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
 linux-kernel@...r.kernel.org, stable@...r.kernel.org,
 Abaci Robot <abaci@...ux.alibaba.com>
Subject: Re: [PATCH -next v3] scsi: sd: Fix an incorrect type in
 'sd_spinup_disk()'

On 7/9/24 2:39 AM, Jiapeng Chong wrote:
> The return value from the call to scsi_execute_cmd() is int. In the
              ^^^^^
               type

> 'else if' branch of the function scsi_execute_cmd, it will return -EINVAL.
> But the type of "the_result" is "unsigned int", causing the error code to
> reverse. Modify the type of "the_result" to solve this problem.
   ^^^^^^^

What is "reversing an error code"? Did you perhaps mean that the return
value is changed from a negative integer to a positive integer?

> ./drivers/scsi/sd.c:2333:6-16: WARNING: Unsigned expression compared
> with zero: the_result > 0.

Doesn't this patch fix reading uninitialized data? If so, shouldn't that
be mentioned in the patch description?

> Fixes: c1acf38cd11e ("scsi: sd: Have midlayer retry sd_spinup_disk() errors")

Hmm ... that seems incorrect to me. Commit c1acf38cd11e changed the
indentation of "the_result > 0" expressions but did not introduce these.
Is this perhaps the commit that introduced the "the_result > 0"
expressions: ced202f7bd78 ("scsi: core: Stop using DRIVER_ERROR")?

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ