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]
Date:	Thu, 10 Oct 2013 19:18:51 -0400
From:	Tejun Heo <tj@...nel.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Joe Perches <joe@...ches.com>,
	"sangjung.woo" <sangjung.woo@...sung.com>,
	Alessandro Rubini <rubini@...dd.com>,
	Russell King <rmk+kernel@....linux.org.uk>,
	rtc-linux@...glegroups.com, linux-kernel@...r.kernel.org,
	Greg KH <greg@...ah.com>
Subject: Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

Hello,

On Thu, Oct 10, 2013 at 04:06:03PM -0700, Andrew Morton wrote:
> On Tue, 08 Oct 2013 21:59:27 -0700 Joe Perches <joe@...ches.com> wrote:
> 
> > I was a bit surprised to find there isn't a devm_kmalloc.
> 
> Yes, the unconditional memset is silly.  Especially when the
> function has a handy gfp_t and could be passed __GFP_ZERO.
> 
> The comment says "managed kzalloc/kfree for device drivers, no kmalloc,
> always use kzalloc".  There's no explanation for this - it looks like
> some ideological thing.

Skipping resetting just is highly unlikely to make any meaningful
difference in the paths devres is supposed to be used.  These don't
and shouldn't get called from hot paths.  Wouldn't it be more
idelogical to have something just because it feels weird not to have
it even if it is not necessary?  I don't necessarily object to having
non-zeroing interface but it seems rather pointless.  Do we have an
actual cases where this makes meaningful differences?

> -	memset(dr, 0, tot_size);
> +	if (gfp & __GFP_ZERO)
> +		memset(dr, 0, tot_size);

I'd much prefer to have at least the devres_node part cleared
regardless of __GFP_ZERO and Joe already has better patches doing
this.

Thanks.

-- 
tejun
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ