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: <2cde383b-156f-48f8-a1f5-344561962f37@stanley.mountain>
Date: Fri, 1 Nov 2024 22:46:37 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Dave Penkler <dpenkler@...il.com>
Cc: gregkh@...uxfoundation.org, linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org, skhan@...uxfoundation.org,
	arnd@...db.de
Subject: Re: [PATCH 1/9] Fix buffer overflow in ni_usb_init

The subject should have a subsystem prefix:

staging: gpib: Fix buffer overflow in ni_usb_init()

On Fri, Nov 01, 2024 at 06:46:57PM +0100, Dave Penkler wrote:
>   The writes buffer size was taking into accont the number of
>   entries causing random oopses.

Remove the blank lines from the start of the line.

> 
> Signed-off-by: Dave Penkler <dpenkler@...il.com>

Add a Fixes tag.

> ---
>  drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
> index 571f07800c9a..9ff56b063681 100644
> --- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
> +++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
> @@ -1726,7 +1726,7 @@ static int ni_usb_init(gpib_board_t *board)
>  	unsigned int ibsta;
>  	int writes_len;
>  
> -	writes = kmalloc(sizeof(*writes), GFP_KERNEL);
> +	writes = kmalloc(sizeof(*writes) * NUM_INIT_WRITES, GFP_KERNEL);

Please use kmalloc_array().

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ