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 9E6DC289E13 for ; Mon, 4 May 2026 08:48:50 +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=1777884530; cv=none; b=i3NdCAyBu78FpR5f5Qy8mhCi0Db7q8fL3v5jQXc08S6KtML0gq2ZiNO6TP2mUy04Y+kg+MwKHhdMOs9mmnS4xWC/gmOPLIe3cUmB5oVXMN5mF8nOr8PpjLJnL4RxueS326ZTGpRdApcdXg2PZnbWPunaZv7mPmmTHo5eQaD70O0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777884530; c=relaxed/simple; bh=oh6NmMjT3tz3bDrw6936iVWPqpOUnKJs+G5LRoxhNUY=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=dUwBbQIKX7ZO02UzONjiderUxzaflKb4V7FhP/KPsJanzOSiRm6uKTQ0/8kA+z8uOalYciWbIPwkdSgUJ8LLvYYg9ALwtXITou56JfIG5de6Vel+EImpUsytery/20E51eZ0HivAI1iXKUYULA7gI4lbCB+G5PH6yFGso1nvBU4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AhYChIiN; 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="AhYChIiN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33BE0C2BCB8; Mon, 4 May 2026 08:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777884530; bh=oh6NmMjT3tz3bDrw6936iVWPqpOUnKJs+G5LRoxhNUY=; h=Subject:To:Cc:From:Date:From; b=AhYChIiNhQbg2+qBOJ4tJaScNP0KJ/ClMmX2/F5fv6ClBCIO5XWagoLSq5lLZ49iM TdUsudVzXP/NOF+Yv6eot3XZI0tkQmd34hKTq5RzoDrkia1rFWgCOuXO63mrZT1y9J p8vms/etnKgARDXW7Hb7zGiO75faTWk3T3vB/I0o= Subject: FAILED: patch "[PATCH] crypto: nx - fix bounce buffer leaks in" failed to apply to 6.1-stable tree To: thorsten.blum@linux.dev,herbert@gondor.apana.org.au Cc: From: Date: Mon, 04 May 2026 10:48:40 +0200 Message-ID: <2026050440-situation-phosphate-8856@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 6.1-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-6.1.y git checkout FETCH_HEAD git cherry-pick -x adb3faf2db1a66d0f015b44ac909a32dfc7f2f9c # git commit -s git send-email --to '' --in-reply-to '2026050440-situation-phosphate-8856@gregkh' --subject-prefix 'PATCH 6.1.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);