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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 16 Jun 2014 11:37:46 -0700
From:	Joe Perches <joe@...ches.com>
To:	Fabian Frederick <fabf@...net.be>
Cc:	linux-kernel@...r.kernel.org,
	Phillip Lougher <phillip@...ashfs.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/1] fs/squashfs/file_direct.c: replace count*size
 kmalloc by kcalloc

On Mon, 2014-06-16 at 20:12 +0200, Fabian Frederick wrote:
> kcalloc manages count*sizeof overflow.

so does kmalloc_array

> diff --git a/fs/squashfs/file_direct.c b/fs/squashfs/file_direct.c
[]
> -	page = kmalloc(sizeof(void *) * pages, GFP_KERNEL);
> +	page = kcalloc(pages, sizeof(void *), GFP_KERNEL);


kmalloc(a * sizeof(b), GFP) -> kmalloc_array(a, sizeof(b), GFP)
kzalloc(a * sizeof(b), GFP) -> kcalloc(a, sizeof(b), GFP)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists