From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757467Ab1ANNcJ (ORCPT ); Fri, 14 Jan 2011 08:32:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65260 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753211Ab1ANNcF (ORCPT ); Fri, 14 Jan 2011 08:32:05 -0500 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: References: To: Jesper Juhl , Mimi Zohar Cc: dhowells@redhat.com, David Safford , James Morris , keyrings@linux-nfs.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Trusted and Encrypted Keys: fix up TSS_rawhmac() so we always kfree() and remember to call va_end() Date: Fri, 14 Jan 2011 13:31:55 +0000 Message-ID: <3820.1295011915@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jesper Juhl wrote: > In security/keys/trusted_defined.c::TSS_rawhmac() we may leak the storage > allocated to 'sdesc' if > data = va_arg(argp, unsigned char *); > results in a NULL 'data' and we then leave the function by returning > -EINVAL. We also neglect calling va_end(argp) in that case and furthermore > we neglect va_end(argp) if > ret = crypto_shash_update(&sdesc->shash, data, dlen); > results in ret being negative and we then jump to the 'out' label. > > I believe this patch takes care of these issues. Please review and > consider for inclusion. > > Signed-off-by: Jesper Juhl Acked-by: David Howells