Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp815741ybl; Wed, 11 Dec 2019 07:57:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyt9YFEpzVEdCTU0njksZXtvS2KSBELHIX/ZhTXxPWx8cl6PlIQOnMGm1MqdWxSnyRr7JQw X-Received: by 2002:aca:815:: with SMTP id 21mr3496389oii.52.1576079850618; Wed, 11 Dec 2019 07:57:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079850; cv=none; d=google.com; s=arc-20160816; b=DsxJn0kj7DrsWQMB57PV9hm9CKV9RPNnRN3OhmyECpISWjFmhBQGhM2NX9UUPnEjm6 Mi3vIZjdC0A7F7PQHhJPbtPBsWKUu9j8pe1PG+fldsfXnGc3lSP03H1Lh5I0JEh0JAi0 FXfoyZDx224ySDxdT+XJYVj3aY3G87tS/LXxyBKLi7E4qw3A0bLKK4gkIlOz0BAHcQdV 6CbN7g2bmiEPfNlxnHGpx2A1oDEpuJN3kPeuXYz8p4jA5VZJLoWo11vLqb8CzW+pN8IA uSqCacb5KN4AN22ndxvCoziRqKx1LULsy6vIE23pH+4Aa+f03Ce56px9IQN7hyy/PuJ7 V8Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UxM8xLafqYEher3vvS3X5S8MPKOz14pa2ORiAMgwx9Y=; b=0Q1QbmNkNO8SDC6YeZrGlFNjac0sE/9Nh2QAJUYA+81hob9/3vEYO9+9izCYZgjy7g XNvrCWobQfXM9+0sC8p+7+9sBtcni03wePfONsfkP7ZUWm6kfqYvWiLqAc2Uu2IoorPs 53NaYnMHQuL9nOjUEq218Rv/sSiK2241XK3gorWJSQE9qCzpiST83lq9PnYzVATTIRkW 7cf+kEFo6SqB3TLNw5SCObhEAvD6iYqF3rkSmhnQ6mUHF4jPxzZ50tO92v9TtXHwuVmN hdAF1BjhGtkaodlt36H/Yz8KwlKmTUXfXpcJRtqT8jP9voR4z5IPtSjyYp6nZWt/y2im V7yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XvLt5Nzu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x26si1384119oto.1.2019.12.11.07.57.18; Wed, 11 Dec 2019 07:57:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XvLt5Nzu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731922AbfLKPzp (ORCPT + 99 others); Wed, 11 Dec 2019 10:55:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:42334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731823AbfLKPPr (ORCPT ); Wed, 11 Dec 2019 10:15:47 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5B562208C3; Wed, 11 Dec 2019 15:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077346; bh=XjHufn7v/xHJflkm4hdu11S4TsZSTicj+Ib/sir+U2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XvLt5Nzuv9cNMtG2qGQATjEO49DnOWLeu9xrfMnlNNLbP8ZJlpRwr2Jpvi0XKHZ8a ysr2THqoGvUx4nH23OMBjHa6JxpRWmyvHpUomK7KzzH9nkYEG/o4PMmQPVnFDeaiC+ cixR4LpdrKm9wf4Hi9GoVFhTBBS31MCHinaXKDHg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Navid Emamdoost , Herbert Xu Subject: [PATCH 5.3 091/105] crypto: user - fix memory leak in crypto_report Date: Wed, 11 Dec 2019 16:06:20 +0100 Message-Id: <20191211150301.178958821@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Navid Emamdoost commit ffdde5932042600c6807d46c1550b28b0db6a3bc upstream. In crypto_report, a new skb is created via nlmsg_new(). This skb should be released if crypto_report_alg() fails. Fixes: a38f7907b926 ("crypto: Add userspace configuration API") Cc: Signed-off-by: Navid Emamdoost Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/crypto_user_base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/crypto/crypto_user_base.c +++ b/crypto/crypto_user_base.c @@ -214,8 +214,10 @@ static int crypto_report(struct sk_buff drop_alg: crypto_mod_put(alg); - if (err) + if (err) { + kfree_skb(skb); return err; + } return nlmsg_unicast(crypto_nlsk, skb, NETLINK_CB(in_skb).portid); }