From patchwork Wed Nov 27 08:49:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 180277 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp5815159ilf; Wed, 27 Nov 2019 00:49:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwORHDFKZ+5x0JczVpzRKHWWNtz5qCqopEbB2u5jMqEVFY7NiCXHzlMRsiVyYLuUe1nb30k X-Received: by 2002:a05:6402:1d8f:: with SMTP id dk15mr1247092edb.29.1574844576539; Wed, 27 Nov 2019 00:49:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574844576; cv=none; d=google.com; s=arc-20160816; b=WPS2DaSLDfYfau8bUkopR10aQ3loZc+qqVrDr2VoSHV+EFQ3YXSHYJJZvqB+kF0bIi fbemPQkscZt2KjbP/i7bOUXSMVZeSChh6rcIi9u4alwWaR1K83RgntSMtm0fHzo8ZErZ Zm0ip1zn+ixeX1eam76W/o6Q4UFiBIPhPK+D2mpJ6y/6Wb+N48raTC9K4c5k7bF6vFmQ xTgdLWC9/92aUir6e3VMRMV9tOhYfJYl6zcEIQYJpSKBO6OdhuY2zOg08NVPICdB7VrD mKkZk8csNBU6B8O8GdW2AQStqUgOJImvtO6mulCzwLErfaXWXUb1Z81nbbU5L2eVw3DX 4Jwg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=o873lY7sS08UnyFnQ1V9h7KzCynMaRiQYvbnwbg71VQ=; b=zi+J954im9uUEgDG8lGlnv8ZPeRZoWUlX/hs29l352zBOMBz8BIidoD0/c+EZJWRzL sdNMCTczISwXTX4bo68Fb0dEp8Y9UiK4IwSfebRT5TV7tDep5MSRBFzYFMjGnNcfofAi giAbLRaY2YPFGc33HSrTx8qGEL3PZVAluMAialI7BeTi/E7LLf/r8/AO5K27MTWdp+ys jafOeH6TWytG04Wr7cZ2SKLF/P44qfZCRb1gizQc03bijIzNZHF6v44TXxuAOPFsdMFI TC5CjKh+dhXJYaDTio10Jevla2RLFjDcMy1loXmbztkdRkt1Scq8h8ZSDQjyv7mNokHZ iDww== ARC-Authentication-Results: i=1; mx.google.com; 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 ce17si10238670edb.368.2019.11.27.00.49.36; Wed, 27 Nov 2019 00:49:36 -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; 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 S1726990AbfK0Itd (ORCPT + 26 others); Wed, 27 Nov 2019 03:49:33 -0500 Received: from foss.arm.com ([217.140.110.172]:44570 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726909AbfK0It2 (ORCPT ); Wed, 27 Nov 2019 03:49:28 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3FC6031B; Wed, 27 Nov 2019 00:49:28 -0800 (PST) Received: from e110176-lin.kfn.arm.com (unknown [10.50.4.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D4DCF3F52E; Wed, 27 Nov 2019 00:49:26 -0800 (PST) From: Gilad Ben-Yossef To: Herbert Xu , "David S. Miller" Cc: Ofir Drang , stable@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] crypto: ccree: fix backlog memory leak Date: Wed, 27 Nov 2019 10:49:08 +0200 Message-Id: <20191127084909.14472-5-gilad@benyossef.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191127084909.14472-1-gilad@benyossef.com> References: <20191127084909.14472-1-gilad@benyossef.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix brown paper bag bug of not releasing backlog list item buffer when backlog was consumed causing a memory leak when backlog is used. Signed-off-by: Gilad Ben-Yossef Cc: stable@vger.kernel.org # v4.19+ --- drivers/crypto/ccree/cc_request_mgr.c | 1 + 1 file changed, 1 insertion(+) -- 2.23.0 diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c index 3ed3164820eb..a5606dc04b06 100644 --- a/drivers/crypto/ccree/cc_request_mgr.c +++ b/drivers/crypto/ccree/cc_request_mgr.c @@ -404,6 +404,7 @@ static void cc_proc_backlog(struct cc_drvdata *drvdata) spin_lock(&mgr->bl_lock); list_del(&bli->list); --mgr->bl_len; + kfree(bli); } spin_unlock(&mgr->bl_lock);