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: <2024052349-gossip-blurry-eda0@gregkh>
Date: Thu, 23 May 2024 09:36:08 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Shichao Lai <shichaorai@...il.com>
Cc: stern@...land.harvard.edu, linux-usb@...r.kernel.org,
	usb-storage@...ts.one-eyed-alien.net, linux-kernel@...r.kernel.org,
	xingwei lee <xrivendell7@...il.com>,
	yue sun <samsun1006219@...il.com>
Subject: Re: [PATCH] Check whether divisor is non-zero before division

On Thu, May 23, 2024 at 03:22:42PM +0800, Shichao Lai wrote:
> Since uzonesize may be zero, so a judgement for non-zero is nessesary.
> 
> Reported-by: xingwei lee <xrivendell7@...il.com>
> Reported-by: yue sun <samsun1006219@...il.com>
> Signed-off-by: Shichao Lai <shichaorai@...il.com>
> ---
>  drivers/usb/storage/alauda.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c
> index 115f05a6201a..db075a8c03cb 100644
> --- a/drivers/usb/storage/alauda.c
> +++ b/drivers/usb/storage/alauda.c
> @@ -947,6 +947,8 @@ static int alauda_read_data(struct us_data *us, unsigned long address,
>  	sg = NULL;
>  
>  	while (sectors > 0) {
> +		if (!uzonesize)
> +			return USB_STOR_TRANSPORT_ERROR;
>  		unsigned int zone = lba / uzonesize; /* integer division */
>  		unsigned int lba_offset = lba - (zone * uzonesize);
>  		unsigned int pages;
> -- 
> 2.34.1
> 
> 

Looks good, thanks!  I'll queue this up after 6.10-rc1 is out.

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ