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 36E4531326C for ; Mon, 4 May 2026 08:48:53 +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=1777884533; cv=none; b=WgVA2WMcO2yAakFpTDMwa62oeScoNimxStok+zASXVpM07xjv6kJ9sUahVcKOZ6L23YNOZhVuk8KMNwfnK6I8tjGGUhfpIT3NmfpfdwQJfSzWMjmApftOicWxS6pYSMeAamO7bY5vNDq7bOmxrGJRwC8l9qVYlDYdB/Zd8ykl5A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777884533; c=relaxed/simple; bh=y0/IW0inahfkp/E6iA5PrN72fM7FHZVGswwwvcKLxBA=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=NQfFFZSR0udaLWPoeWUsS+JTFbRCjUVYOHAhBNB/I1c7P+HHZwYOjU8/hE8Hq0UjfD9fRktF2kEyobVoQ4d47+Sk3XPaaZpZ23GPkTGm/MOGMP3Q8CyJ84rRGp3SG8t6l39f+MQrj10/Tr8DpQlgRMM1mosBqDeAkJYhGkz8dMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1d2PuSU1; 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="1d2PuSU1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDB70C2BCB8; Mon, 4 May 2026 08:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777884533; bh=y0/IW0inahfkp/E6iA5PrN72fM7FHZVGswwwvcKLxBA=; h=Subject:To:Cc:From:Date:From; b=1d2PuSU1PInvBXn2WBcq/JhXB04g6BPwJHpxujbZ8GEerX4ePBnGaHJLfQAksetZI 0cy4o4l+JkOVg9uErSvkZz1mz2zVoWUz+gLLg5cGMo4G7zbfAsR+RK4221vFiDu4mC swNl/3+j2MBR9UNCa78/gNw0fOpfb6u948loCM/8= Subject: FAILED: patch "[PATCH] crypto: nx - fix bounce buffer leaks in" failed to apply to 5.15-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-badge-crushed-0fc1@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.15-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.15.y git checkout FETCH_HEAD git cherry-pick -x adb3faf2db1a66d0f015b44ac909a32dfc7f2f9c # git commit -s git send-email --to '' --in-reply-to '2026050440-badge-crushed-0fc1@gregkh' --subject-prefix 'PATCH 5.15.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);