From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935156AbdIYOTA (ORCPT ); Mon, 25 Sep 2017 10:19:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47462 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933355AbdIYOS7 (ORCPT ); Mon, 25 Sep 2017 10:18:59 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DAEAB80C0D Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dhowells@redhat.com 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: <20170921205742.144596-2-ebiggers3@gmail.com> References: <20170921205742.144596-2-ebiggers3@gmail.com> <20170921205742.144596-1-ebiggers3@gmail.com> To: Eric Biggers Cc: dhowells@redhat.com, keyrings@vger.kernel.org, Michael Halcrow , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Biggers Subject: Re: [PATCH v2 1/3] KEYS: fix cred refcount leak in request_key_auth_new() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30851.1506349137.1@warthog.procyon.org.uk> Date: Mon, 25 Sep 2017 15:18:57 +0100 Message-ID: <30852.1506349137@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 25 Sep 2017 14:18:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eric Biggers wrote: > + rka = kzalloc(sizeof(*rka), GFP_KERNEL); > + if (!rka) > + goto error_free_rka; But you haven't allocated an rka if you're in the error path. I'll fix that to jump over the release. David