Received: by 2002:ab2:855:0:b0:1ef:b27b:cc29 with SMTP id 21csp1722338lqy; Fri, 29 Mar 2024 06:50:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUa9mJW1p4s/VTIdzXFnT8q0JtNN15TzmP45PRyVxNZsf4dcRFjtMrpEmKzGoFpaOF7EUoodEuooTpLq2xgeYwcYlq8Ldsl+jxVl/dqGw== X-Google-Smtp-Source: AGHT+IH8HH3u4MlznSkRHsRJJwYjEGyM+el5Ol3rSoeBFjIlhP4/NeiM22mGZOBfgVB2+/y+RT1l X-Received: by 2002:a17:906:e0c9:b0:a4d:f8c4:19a4 with SMTP id gl9-20020a170906e0c900b00a4df8c419a4mr2020228ejb.5.1711720220716; Fri, 29 Mar 2024 06:50:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711720220; cv=pass; d=google.com; s=arc-20160816; b=DvYj9czxjx7hs8LijOK2CTrF8S6QxpAaOhyAemdVQ0fzT6kk85WPz5ZWLxSyVnEIcI 2eSf5FvduAqXvSLoxjlze6Mc8JYCVL1Gu9eau4ZS+bj1dsoz/xq+G0yinsQzWEOPc7qt qrBOhNEP/DjiJ3g9l+b5T25dPSYozJBlyW3k+jjSwdgtdM40AjX/9/oixaQGikHVnMqU DGDEP9lkPJ1K+TdMEqvf63JdjhOpyU/KDl1WxuGycf3qcI1NABezFE1DqL/dZkQY4WEf vMmEzj7CQEbs+ML7SGC2udsKuJCmDg/ZKPghaTjNBsEj9AnBSgErlP6Dn8gatNRQTAOs DO4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bjw7Qx1S4dP+gNgKytWMvXvNJIqoQcmMrzbNHgOXXrU=; fh=M5u2yY+06ZtWZ+lakuggpJ/ut0ulL6AszP9kE5ANWqc=; b=HTg2Cnng2/Q84PCZRA3vU4NELaA8l46PEVavBBPWRribTFX+kh4p8v/0175n+WCd4J ZaF3EF2moTk1ftykXFdjEKW4nzCf6RNiVLtib1LIcvz3S2QhzrAmXedSLwCM15mvi6AR FsiGFyf8vksxVfsHzZVenaCPoJfniaqZH3r/ouQV12yjGr6MpoQGNXhZlCD2y9Vv42qG O6bXp4upswwOw3TIQiNNb5Mtz6YgO4AFE2QZL0yGY7f7vOKd8AIFwD+mkO9CswgHdAcE EAdsy8CSBn5S93NVio2e9fsIQXcdA+j1Nb2+uie7rXDbBGQSYO2m4w9+XkG23qqULgtD CA3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g6L83uDw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124782-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124782-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u13-20020a170906408d00b00a4a3403340fsi1786260ejj.146.2024.03.29.06.50.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 06:50:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124782-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g6L83uDw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124782-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124782-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1A2A61F25461 for ; Fri, 29 Mar 2024 13:50:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9900318788D; Fri, 29 Mar 2024 12:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g6L83uDw" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B849E18766D; Fri, 29 Mar 2024 12:42:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716133; cv=none; b=pIW2rMg+5oFG7xl7PwiqftH4IVDZlMxksZNlhGmrzAPjyaR9rMEMWd0q2esuB/Emvqk+0uY+JLLQPBZ3YLxdnrq7aKirvPYoUtjU/xtwIvJvse/JtDF4LF1URXjimbbpEB3tQtESsiUVPONaGcXND3U2uUzYlmzrLFCQZmsfFp0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716133; c=relaxed/simple; bh=d5irRUJ+Xrb90VdHOxAtw9bB+4PWO4IFVtpurXE1w/c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aMKEl3XQQp6SEL7rbkXzN6iL2Ec2svdw128LXVyW5/Wu0rUszX8qruqwxchxYTsg8UsmafkpjqAPjBQThEoZAqyXgTQaiLiAnUwIDRPupndHa2btUsUl3yUiqkqP2BXMVyWFH1H0V8RC7ROgwp9voF0az/4A0wQZJloxAzxFjU4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g6L83uDw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD403C433C7; Fri, 29 Mar 2024 12:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711716133; bh=d5irRUJ+Xrb90VdHOxAtw9bB+4PWO4IFVtpurXE1w/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g6L83uDwfq6omjp+H+zrXtr6H3j/MB1Re51BbZ9lUpyHgZpp9iHE+zZxuPRy0Mrwz 3tUJR+RTS7qKp0l12Wk9n+S5ztgYnIyizp5TxdJws2uYu/NuAtMNpOf1cxkcMHp+ek RepnQ1RnT6TBYRILm/dgD5Cxh72y5JXhi/sg/UxlCtRHqiCE0/OqFyj6XM+5F5NRDl f8/c9HFxNfVe3rF11w/nUsT7CN4ZJRbLedMg70yuOdCtRNGfnyYxOwHuMZmkLAGcGi M4cyvM9s8XjaHBfjoKBavL+LopyC5wJji0dmGozeZ15z3rnI7amQ5udEnYUwwsQky6 fb+522WLNtGkw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tom Zanussi , Herbert Xu , Sasha Levin , davem@davemloft.net, linux-crypto@vger.kernel.org Subject: [PATCH AUTOSEL 6.8 72/98] crypto: iaa - Fix async_disable descriptor leak Date: Fri, 29 Mar 2024 08:37:43 -0400 Message-ID: <20240329123919.3087149-72-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240329123919.3087149-1-sashal@kernel.org> References: <20240329123919.3087149-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.2 Content-Transfer-Encoding: 8bit From: Tom Zanussi [ Upstream commit 262534ddc88dfea7474ed18adfecf856e4fbe054 ] The disable_async paths of iaa_compress/decompress() don't free idxd descriptors in the async_disable case. Currently this only happens in the testcases where req->dst is set to null. Add a test to free them in those paths. Signed-off-by: Tom Zanussi Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/intel/iaa/iaa_crypto_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c index dfd3baf0a8d87..afa4eacdd8701 100644 --- a/drivers/crypto/intel/iaa/iaa_crypto_main.c +++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c @@ -1324,7 +1324,7 @@ static int iaa_compress(struct crypto_tfm *tfm, struct acomp_req *req, *compression_crc = idxd_desc->iax_completion->crc; - if (!ctx->async_mode) + if (!ctx->async_mode || disable_async) idxd_free_desc(wq, idxd_desc); out: return ret; @@ -1570,7 +1570,7 @@ static int iaa_decompress(struct crypto_tfm *tfm, struct acomp_req *req, *dlen = req->dlen; - if (!ctx->async_mode) + if (!ctx->async_mode || disable_async) idxd_free_desc(wq, idxd_desc); /* Update stats */ -- 2.43.0