From patchwork Sun Mar 16 09:50:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 874017 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) (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 311E519AD8B for ; Sun, 16 Mar 2025 09:50:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=144.6.53.87 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742118635; cv=none; b=gZdQh8CP5DIT9qFZuVXmQK4sZtrLsOincPBe8NCfnMvgLbTmg8GX4jTFUW5DmR2pGMHl3FZki89+QUqwfhJqaYZkyYUGckPdROCcBhY81krgt/2TV6mT1Mzab0Si6kiL4pNE9l7fakf8jVKAbhJ4W7lC0/he5uOW3ULvd8fvd4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742118635; c=relaxed/simple; bh=9fccqMSF/nwICLVKVsQI4AOo8ZxTPLgAq2+Ja4H9/JA=; h=Date:Message-Id:In-Reply-To:References:From:Subject:To; b=HenqGPv9w7zZyu7yEq5VZ9zkRLr+RxjP30l/AcZwsaNDe7S7xqyDaUaSTtejcKyikuZFNBkHQs1hDU3dsqGmMKlDks2km4kPdIc1Yy+deHxBDxiB+jBsIZfXTtABdTYQkBPq8fTAfQTMIk3O4EmMgn4raw55fz8Vo7Sgb07FRcg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au; spf=pass smtp.mailfrom=gondor.apana.org.au; dkim=pass (2048-bit key) header.d=hmeau.com header.i=@hmeau.com header.b=gy/K64pa; arc=none smtp.client-ip=144.6.53.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hmeau.com header.i=@hmeau.com header.b="gy/K64pa" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hmeau.com; s=formenos; h=To:Subject:From:References:In-Reply-To:Message-Id:Date:Sender: Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=hsfYLoQzxjHxxPx4dgRWXQG8hKIEZBOvIYxZBwcHG/o=; b=gy/K64paE52/FwwrMsKrCEjoVt 1EJufZr4gKqovDQ+JRPTbpFUFruguHD/CA4AysenYq0pRp1clRs2ZDyD9zwfa4VO4oWT5bIKpb7YS CcmL8vXytk9U+rHRA2aUjdUG/V2rIh96U+Pbw79DqxF3r91bC4lyrfepnZwhq1bxqRyhWB1BAnMyU u0GY0r2MLaHBKPvNO75j6BduEk1yp7iiOqSTPlJH+AITMKySlzfRyeBW3Grvi78AbFj800OLbpulR Ts5px81B1JjBFmmhN4LhLq5F4JvFTvoz6TY16niXMide4x6/cvAJlbFFnhgMwSi7klyFi503IEL9e xzDSQ5Jw==; Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.96 #2 (Debian)) id 1ttkdS-0071Mo-0M; Sun, 16 Mar 2025 17:50:23 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Sun, 16 Mar 2025 17:50:22 +0800 Date: Sun, 16 Mar 2025 17:50:22 +0800 Message-Id: In-Reply-To: References: From: Herbert Xu Subject: [PATCH 1/2] crypto: scompress - Fix incorrect stream freeing To: Linux Crypto Mailing List Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Fix stream freeing crash by passing the correct pointer. Fixes: 3d72ad46a23a ("crypto: acomp - Move stream management into scomp layer") Signed-off-by: Herbert Xu --- crypto/scompress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/scompress.c b/crypto/scompress.c index 57bb7353d767..d4be977b9729 100644 --- a/crypto/scompress.c +++ b/crypto/scompress.c @@ -117,7 +117,7 @@ static void scomp_free_streams(struct scomp_alg *alg) if (!ps->ctx) break; - alg->free_ctx(ps); + alg->free_ctx(ps->ctx); } free_percpu(stream); From patchwork Sun Mar 16 09:50:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 874216 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) (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 A6CD019D881 for ; Sun, 16 Mar 2025 09:50:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=144.6.53.87 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742118636; cv=none; b=dpfWW7gTDXRWc2gUDHJX9vdakL3JlxFYkdQ1OY/FPNNBHpDt/Jq0U6kJyR4UX6WcEHn24dBs9khDtcv5PxR1MYphYaNPQ82WPA7IdVfHGpzU4Jkm3jAJLWgOkq047yMcY5IvbEKbYm07v3c1dpkkzExMmikz4h94RgRVYpslqFE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742118636; c=relaxed/simple; bh=6xCFkV7v7sDy8YUiT2EWSjEfzqjXC6WDZphaNmhfwgQ=; h=Date:Message-Id:In-Reply-To:References:From:Subject:To; b=ZWLa1vydbLmqKvmgKRqnUR/T2RNlCt8cMQ43T3Tgvhzpwq9L4Aa8hOlONQ3AIaHgipUkL3IieJHGQaE7Hpx/+wBEsINkDDc6J02FI+MzOk7oTr5kPASMr2ajaZ82lqbOLb6p5ezhgSqQrme1S+1ZaXXTTrjiLY8vmYljBxC0rWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au; spf=pass smtp.mailfrom=gondor.apana.org.au; dkim=pass (2048-bit key) header.d=hmeau.com header.i=@hmeau.com header.b=MSWUKWV0; arc=none smtp.client-ip=144.6.53.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hmeau.com header.i=@hmeau.com header.b="MSWUKWV0" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hmeau.com; s=formenos; h=To:Subject:From:References:In-Reply-To:Message-Id:Date:Sender: Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YiYbKlEevS2bTqkd6sOGvvxgDc6qLT8lAFTR6aIdSiI=; b=MSWUKWV0jCDzBPVnn0SbylydZ8 SRl8jP54EfSi5D85akgpvNCf6FeH94BfsHxy0y71LWI7M7fBotZen+KJ+o2cWfs/h3zTocv7cVy1O y8Y+jDQssL8UBHG3QF033/5mzSO8Y6hsehXHyV3bqi5nVG5ZKeBl2Sm8O+P1Dm0Hrnoc8kUWqf9pF OTfDKxaSqH0inCjNC2Dv994+6eMPoQOEg+RXsAwczhHN3sikGNPSmoYc53UfZJN1xuOa/jnSaSyvT un8ad0ZQkmf3aDB/sVWyyDQThxvAS64p3tvsLLmiEMj4u/hWAd5MbvURXeNNFO/ky7TZwmY2IO4Db qhYWprpA==; Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.96 #2 (Debian)) id 1ttkdU-0071My-1G; Sun, 16 Mar 2025 17:50:25 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Sun, 16 Mar 2025 17:50:24 +0800 Date: Sun, 16 Mar 2025 17:50:24 +0800 Message-Id: <256244bca7aff91e33804eac225e7c8e83d737a5.1742118507.git.herbert@gondor.apana.org.au> In-Reply-To: References: From: Herbert Xu Subject: [PATCH 2/2] crypto: api - Call crypto_alg_put in crypto_unregister_alg To: Linux Crypto Mailing List Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Instead of calling cra_destroy by hand, call it through crypto_alg_put so that the correct unwinding functions are called through crypto_destroy_alg. Fixes: 3d6979bf3bd5 ("crypto: api - Add cra_type->destroy hook") Signed-off-by: Herbert Xu --- crypto/algapi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto/algapi.c b/crypto/algapi.c index e7a9a2ada2cf..ea9ed9580aa8 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -464,8 +464,7 @@ void crypto_unregister_alg(struct crypto_alg *alg) if (WARN_ON(refcount_read(&alg->cra_refcnt) != 1)) return; - if (alg->cra_destroy) - alg->cra_destroy(alg); + crypto_alg_put(alg); crypto_remove_final(&list); }