From mboxrd@z Thu Jan 1 00:00:00 1970 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 9E0E2342144 for ; Mon, 4 May 2026 08:48:58 +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=1777884538; cv=none; b=PFYl7hrlGJxPeVm2AmLIejNsgS1cY4V5/At4D6pVR2e0vP154dPLQSykcBsia5o4SlBy+vtpFM2E4Jo6y+PLWqPtd/Gcy6DYRY+dDeETiLdPcxyWMfxw/WgzaWiRBWr/maRfAIKWPXgcYrbfuvtWOk0Wh39Z15H0SJfIzx1DdeA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777884538; c=relaxed/simple; bh=IH90qlRo1hoJzrbzJsKEMi+EFTZ9eI5HxKXaynJTuRc=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=EWAxxbPAhgWOrONtVat86bmDJGEQYZwgI7i15tcfzspQrC1X1qJUmk0OQ8LSOq5MuwIKfNeYOsszTRx2grUpfGgGyLUFT3O8Z/dUMBFWfJO5CnkPCAN/J4EBsKU/xzWvwdTP7QMV6rrpk608kgay/TpYT1cID6BkTS53LA2TNUo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wpEgj0bd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wpEgj0bd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA350C2BCB8; Mon, 4 May 2026 08:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777884538; bh=IH90qlRo1hoJzrbzJsKEMi+EFTZ9eI5HxKXaynJTuRc=; h=Subject:To:Cc:From:Date:From; b=wpEgj0bd1jX+LuhasHDyY/vGl+TuPc7PoilUAGnYC6YBeplWljMxU1iK16F7zX3CE kZngzbnnxnG4rfjRpoW+eFQH5fJvmMZ4iQYIT8yGLXLsxZlnKdvoWaYn8XFF4IGNQb Jt5YmCjhQN8F0A3FFziWmCOmcu9B9uwHhbnDj7IU= Subject: FAILED: patch "[PATCH] crypto: nx - fix bounce buffer leaks in" failed to apply to 5.10-stable tree To: thorsten.blum@linux.dev,herbert@gondor.apana.org.au Cc: From: Date: Mon, 04 May 2026 10:48:41 +0200 Message-ID: <2026050441-husband-doze-7f82@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x adb3faf2db1a66d0f015b44ac909a32dfc7f2f9c # git commit -s git send-email --to '' --in-reply-to '2026050441-husband-doze-7f82@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From adb3faf2db1a66d0f015b44ac909a32dfc7f2f9c Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Wed, 11 Mar 2026 16:56:47 +0100 Subject: [PATCH] crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx The bounce buffers are allocated with __get_free_pages() using BOUNCE_BUFFER_ORDER (order 2 = 4 pages), but both the allocation error path and nx842_crypto_free_ctx() release the buffers with free_page(). Use free_pages() with the matching order instead. Fixes: ed70b479c2c0 ("crypto: nx - add hardware 842 crypto comp alg") Cc: stable@vger.kernel.org Signed-off-by: Thorsten Blum Signed-off-by: Herbert Xu diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c index b61f2545e165..661568ce47f0 100644 --- a/drivers/crypto/nx/nx-842.c +++ b/drivers/crypto/nx/nx-842.c @@ -116,8 +116,8 @@ void *nx842_crypto_alloc_ctx(struct nx842_driver *driver) ctx->dbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER); if (!ctx->wmem || !ctx->sbounce || !ctx->dbounce) { kfree(ctx->wmem); - free_page((unsigned long)ctx->sbounce); - free_page((unsigned long)ctx->dbounce); + free_pages((unsigned long)ctx->sbounce, BOUNCE_BUFFER_ORDER); + free_pages((unsigned long)ctx->dbounce, BOUNCE_BUFFER_ORDER); kfree(ctx); return ERR_PTR(-ENOMEM); } @@ -131,8 +131,8 @@ void nx842_crypto_free_ctx(void *p) struct nx842_crypto_ctx *ctx = p; kfree(ctx->wmem); - free_page((unsigned long)ctx->sbounce); - free_page((unsigned long)ctx->dbounce); + free_pages((unsigned long)ctx->sbounce, BOUNCE_BUFFER_ORDER); + free_pages((unsigned long)ctx->dbounce, BOUNCE_BUFFER_ORDER); } EXPORT_SYMBOL_GPL(nx842_crypto_free_ctx);