Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp815124ybl; Wed, 11 Dec 2019 07:56:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyDCUvc2xxYA7BO/AlNPCl36x+dooXA3BBDjZHuXpaoHKWaFIoZ2wmLJX9HplNidMPYlbGF X-Received: by 2002:a05:6808:56:: with SMTP id v22mr3143491oic.37.1576079814920; Wed, 11 Dec 2019 07:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079814; cv=none; d=google.com; s=arc-20160816; b=Vr5VLILlOzifvP8Ln++Rj36VJC7ImAi7yopXnNiNqyt2niuzw0cppiJ3IRaRP3A7gW a9jePdSfez7k+ebMOFr64cfncrVd01WHisgbuNnB2OWgsiuITGdKitNw47OMPLgt1kFU pQ5mtmvsOS2iyAn0EZF8v/4uTcpAU1pY0ticE4/BCsWngVg/Eq9xepebe4VdoAbaPtB7 o64tE8CpLRp1XG/UXIpK/r/R6+w56VUQqujHB+KeBwYt41qUxj6Twq+7KUddGiMM+uQi 9i3ezjl7z+GJ2BR1o/MZI0VxsQ/7jUfk0YnNhJ/xBQVmfnsfVB3wQBjz3tIJ5iHnuYkB wbtA== 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=9nKzaAf1ryUBURSi9z5oFbKuxOvyVo8mWr9ex8KJyEk=; b=rZqAm2Wzlf5Ozm79Xa9/X7geQK7CVINUsHpzk15Zd0KTdtoXmz/SR1xpTu7yQX/79y Vga3iKEP4ZT2uf5xNB6fcpagxkUVSmGwRmHXSYXY+In0y/Na8xupj8SHSd/qIj4vT3ro Kx0CoF5SH2chDuYlA4DWODOPeMGp455C8UZccteokVjT1JfiXXA1FLst/Jh64+9LyqCm +2/rEblpJhIFjVlWQ4lxXHZXweJBlbOXrVoyazBRnAuH3qxwc6n063PACXpO6z1hOSCm +Z095gTnAIq4qa80w4xbgRwvRGUIvTjZv9Crw9Bwk2IU29cfJnRTLFoXUHjWTz+nGkzW atYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JAFHnjJP; 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 e10si1131748oti.61.2019.12.11.07.56.43; Wed, 11 Dec 2019 07:56:54 -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=JAFHnjJP; 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 S1731093AbfLKPP4 (ORCPT + 99 others); Wed, 11 Dec 2019 10:15:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:42412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731834AbfLKPPt (ORCPT ); Wed, 11 Dec 2019 10:15:49 -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 D6212208C3; Wed, 11 Dec 2019 15:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077349; bh=TM44OjMYG7+v7HfmjBTcpsYK475VNjtqcmI10Oq1gjg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JAFHnjJPDEbkYnqB8qy8rJt/fIueb5BbEzU6n/SFbp60vV+MGozEHzBDdYUrcuyAC kiFPGIyEQ6XwM3/kzlOC6Ms0miE4JJ7Yo9gp+kxFgoP1IWaYMR9HZEpB4QCGJ2w/GO EJ7yFqgWtxg44Kybhktblyldyz7PoIXsErXucxBk= 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 092/105] crypto: user - fix memory leak in crypto_reportstat Date: Wed, 11 Dec 2019 16:06:21 +0100 Message-Id: <20191211150301.352600702@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 c03b04dcdba1da39903e23cc4d072abf8f68f2dd upstream. In crypto_reportstat, a new skb is created by nlmsg_new(). This skb is leaked if crypto_reportstat_alg() fails. Required release for skb is added. Fixes: cac5818c25d0 ("crypto: user - Implement a generic crypto statistics") Cc: Signed-off-by: Navid Emamdoost Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/crypto_user_stat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/crypto/crypto_user_stat.c +++ b/crypto/crypto_user_stat.c @@ -326,8 +326,10 @@ int crypto_reportstat(struct sk_buff *in 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); }