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: <bbb46821-25dc-4f5d-a6bf-cbef34024afd@acm.org>
Date: Fri, 31 Jan 2025 12:32:23 -0800
From: Bart Van Assche <bvanassche@....org>
To: Jiasheng Jiang <jiashengjiangcool@...il.com>, skashyap@...vell.com,
 jhasan@...vell.com, GR-QLogic-Storage-Upstream@...vell.com,
 James.Bottomley@...senPartnership.com, martin.petersen@...cle.com,
 manish.rangankar@...ium.com, nilesh.javali@...ium.com, arun.easi@...ium.com
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: qedf: Use kzalloc() and add check for bdt_info

On 1/31/25 11:54 AM, Jiasheng Jiang wrote:
> -	cmgr->io_bdt_pool = kmalloc_array(num_ios, sizeof(struct io_bdt *),
> -	    GFP_KERNEL);
> +	cmgr->io_bdt_pool = kzalloc(num_ios * sizeof(struct io_bdt *), GFP_KERNEL);

Please do not reintroduce the possibility of multiplication overflow. 
What is wrong with adding __GFP_ZERO to the second kmalloc_array()
argument or with using kcalloc()? From include/linux/slab.h:

#define kcalloc(n, size, flags) kmalloc_array(n, size, (flags) | __GFP_ZERO)

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ