From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262827AbVHESUd (ORCPT ); Fri, 5 Aug 2005 14:20:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262818AbVHESSa (ORCPT ); Fri, 5 Aug 2005 14:18:30 -0400 Received: from graphe.net ([209.204.138.32]:61610 "EHLO graphe.net") by vger.kernel.org with ESMTP id S262827AbVHESQv (ORCPT ); Fri, 5 Aug 2005 14:16:51 -0400 Date: Fri, 5 Aug 2005 11:16:37 -0700 (PDT) From: Christoph Lameter X-X-Sender: christoph@graphe.net To: Stephen Pollei cc: Roman Zippel , Arjan van de Ven , Andrew Morton , Pekka J Enberg , linux-kernel@vger.kernel.org, pmarques@grupopie.com, Linus Torvalds Subject: Re: [PATCH] kernel: use kcalloc instead kmalloc/memset In-Reply-To: Message-ID: References: <1123219747.20398.1.camel@localhost> <20050804223842.2b3abeee.akpm@osdl.org> <20050804233634.1406e92a.akpm@osdl.org> <1123235219.3239.46.camel@laptopd505.fenrus.org> <1123236831.3239.55.camel@laptopd505.fenrus.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Score: -5.8 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 5 Aug 2005, Stephen Pollei wrote: > > On Fri, 5 Aug 2005, Arjan van de Ven wrote: > > > > This would imply a similiar kmalloc() would be useful as well. > > > > Second, how relevant is it for the kernel? > > > we've had a non-negliable amount of security holes because of this > > So why don't we have a similiar kmalloc()? > You mean something like: > static void __bad_kmalloc_safe_nonconstant_size(void); Hmm. If we had kcmalloc then we may be able to add a zero bit to the slab allocator. If we would obtain zeroed pages for the slab then we may skip zeroing of individual entries. However, the cache warming effect of the current zeroing is then not occurring. Not sure if this would make sense but this is a possible optimization if we had kcmalloc.