All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Bart Van Assche <bvanassche@acm.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	Damien Le Moal <Damien.LeMoal@wdc.com>
Subject: Re: [PATCH] scsi: sd_zbc: Support disks with more than 2**32 logical blocks
Date: Sun, 19 Sep 2021 10:14:20 +0200	[thread overview]
Message-ID: <4a91c052-3d60-6fe4-bf4c-50487ef562b7@suse.de> (raw)
In-Reply-To: <20210917212314.2362324-1-bvanassche@acm.org>

On 9/17/21 11:23 PM, Bart Van Assche wrote:
> This patch addresses the following Coverity report about the
> zno * sdkp->zone_blocks expression:
> 
> CID 1475514 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
> overflow_before_widen: Potentially overflowing expression zno *
> sdkp->zone_blocks with type unsigned int (32 bits, unsigned) is evaluated
> using 32-bit arithmetic, and then used in a context that expects an
> expression of type sector_t (64 bits, unsigned).
> 
> Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Cc: Damien Le Moal <Damien.LeMoal@wdc.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Fixes: 5795eb443060 ("scsi: sd_zbc: emulate ZONE_APPEND commands")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>   drivers/scsi/sd_zbc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
> index b9757f24b0d6..ded4d7a070a0 100644
> --- a/drivers/scsi/sd_zbc.c
> +++ b/drivers/scsi/sd_zbc.c
> @@ -280,7 +280,7 @@ static void sd_zbc_update_wp_offset_workfn(struct work_struct *work)
>   {
>   	struct scsi_disk *sdkp;
>   	unsigned long flags;
> -	unsigned int zno;
> +	sector_t zno;
>   	int ret;
>   
>   	sdkp = container_of(work, struct scsi_disk, zone_wp_offset_work);
> 
Of course.

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

  parent reply	other threads:[~2021-09-19  8:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 21:23 [PATCH] scsi: sd_zbc: Support disks with more than 2**32 logical blocks Bart Van Assche
2021-09-18  7:12 ` Damien Le Moal
2021-09-19  8:14 ` Hannes Reinecke [this message]
2021-09-20  7:22 ` Johannes Thumshirn
2021-09-20 14:04 ` Himanshu Madhani
2021-09-22  4:44 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4a91c052-3d60-6fe4-bf4c-50487ef562b7@suse.de \
    --to=hare@suse.de \
    --cc=Damien.LeMoal@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.