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: <98e7be8d-9288-4ecd-9e97-51d4cbe0f47e@acm.org>
Date: Wed, 3 Dec 2025 16:02:58 -1000
From: Bart Van Assche <bvanassche@....org>
To: sw.prabhu6@...il.com, James.Bottomley@...senPartnership.com,
 martin.petersen@...cle.com, linux-scsi@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, mcgrof@...nel.org, kernel@...kajraghav.com,
 Swarna Prabhu <s.prabhu@...sung.com>
Subject: Re: [RFC v2 2/2] scsi: scsi_debug: enable sdebug_sector_size >
 PAGE_SIZE

On 12/3/25 1:05 PM, sw.prabhu6@...il.com wrote:
> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
> index b2ab97be5db3..b5839e62d3bb 100644
> --- a/drivers/scsi/scsi_debug.c
> +++ b/drivers/scsi/scsi_debug.c
> @@ -8459,13 +8459,8 @@ static int __init scsi_debug_init(void)
>   	} else if (sdebug_ndelay > 0)
>   		sdebug_jdelay = JDELAY_OVERRIDDEN;
>   
> -	switch (sdebug_sector_size) {
> -	case  512:
> -	case 1024:
> -	case 2048:
> -	case 4096:
> -		break;
> -	default:
> +	if (sdebug_sector_size < 512 || sdebug_sector_size > BLK_MAX_BLOCK_SIZE ||
> +	    !is_power_of_2(sdebug_sector_size)) {
>   		pr_err("invalid sector_size %d\n", sdebug_sector_size);
>   		return -EINVAL;
>   	}

Please use blk_validate_block_size() instead of open-coding it.

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ