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 74414289E13 for ; Mon, 4 May 2026 08:48:42 +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=1777884522; cv=none; b=MErnYWzLsTSkhGPTOKQqbbkULiyc2mbcuP9yNVww6w9n3gl4g6ePDQ6oY8hflza2yC3YTTvU9CG7eAsSYqBZOUuyfUG682PpsecPI3L3jiOyVxc+wOQey45MFWeXUiKXwi/5BLh3vBci7JzTvRvSTGFNGCUQpItRkszw6mWtfKA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777884522; c=relaxed/simple; bh=QCSfXzwPfwPMQ2OM42C4hbD01eTM1jDxHxjL0gFJEzU=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=YZsntl7OXfcvEtGj00ZyTVxosBPTEaew5OH8oCqtcnknh9PiqTgJjmKhNU5MlDMjGr1OcDY1ePqt0RN+cvtugqUkZ8RIS0j11CN0dMK27QUivprN3w+t44RVsAKnZwBoasEoYjXUKiuqnk70UxTLnGUP4f/lLaTWtyLKfh99S2M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dUm23I1d; 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="dUm23I1d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB978C2BCB9; Mon, 4 May 2026 08:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777884522; bh=QCSfXzwPfwPMQ2OM42C4hbD01eTM1jDxHxjL0gFJEzU=; h=Subject:To:Cc:From:Date:From; b=dUm23I1dFKvTRKpwv9JBGhxWi3+9GCQZAdLxZSEG8MMFM4tvYslaByhumWO8EqBN0 ZFrS49fdcU8hxnjw9NWps3WfXHOs1CT0PauuUbKWj6zXYnrx+/ute4wVQo34BY/nLx feKt0T6P9s6BFmwyRn/c9pYbwJCLdX7bq86KII0k= Subject: FAILED: patch "[PATCH] crypto: nx - fix bounce buffer leaks in" failed to apply to 6.12-stable tree To: thorsten.blum@linux.dev,herbert@gondor.apana.org.au Cc: From: Date: Mon, 04 May 2026 10:48:39 +0200 Message-ID: <2026050439-baggie-overstep-db93@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.12-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.12.y git checkout FETCH_HEAD git cherry-pick -x adb3faf2db1a66d0f015b44ac909a32dfc7f2f9c # git commit -s git send-email --to '' --in-reply-to '2026050439-baggie-overstep-db93@gregkh' --subject-prefix 'PATCH 6.12.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);