From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932934Ab0EDO6E (ORCPT ); Tue, 4 May 2010 10:58:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5047 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932366Ab0EDO57 (ORCPT ); Tue, 4 May 2010 10:57:59 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20100427164517.GC7530@us.ibm.com> References: <20100427164517.GC7530@us.ibm.com> <20100427164139.GA7359@us.ibm.com> To: "Serge E. Hallyn" Cc: dhowells@redhat.com, lkml , Ashwin Ganti , Greg KH , rsc@swtch.com, ericvh@gmail.com, linux-security-module@vger.kernel.org, Ron Minnich , jt.beard@gmail.com, Andrew Morgan , Andrew Morton , Oleg Nesterov , Eric Paris , "Eric W. Biederman" , Randy Dunlap , Michael Kerrisk , Alan Cox , Kyle Moffett , Steve Grubb Subject: Re: [PATCH 3/3] RFC: p9auth: add p9auth fs Date: Tue, 04 May 2010 15:57:17 +0100 Message-ID: <4067.1272985037@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Serge E. Hallyn wrote: > + result = kzalloc(MAX_DIGEST_SIZE, GFP_KERNEL); > ... > + ret = crypto_hash_digest(&desc, &sg, plain_text_size, result); Does result have to be pre-cleared? > + user_buf = kzalloc(count+1, GFP_KERNEL); > + if (!user_buf) > + goto out; > + > + if (copy_from_user(user_buf, buffer, count)) { user_buf doesn't need preclearing. It's just a waste of time. This occurs three times. David