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 73E2F3AE19B for ; Tue, 17 Mar 2026 12:53:20 +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=1773752000; cv=none; b=OK9fLSU4ajczSVAXmbvsYM6BX7TyXSoS7RABcJLVQQpYDLZWfIusJUGNlFFuBEO3MIH0447oDOVFwztE5DBlvhEYMBtXy2zXYJqJkYzlw/OPkDGQWqkr9eml5D0CtBq7k7eI6/Rh0j2J4jBzZMtnXYEE6lqovj8Pw1KlOk9aakg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773752000; c=relaxed/simple; bh=5z6+ur2AWx/RXwWHSspZnMyX6cci75dluyiHroliPAY=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=M44O8UWY0aS9b6W+VVn0WE3/1PHCS4rW6kZT30Uh2oK7IarPWWvyVYORxZoZQy4Y96bkgHaWxurGNsA6yzbgMwMGzAeCy4k52gb0Hj4E9A1WxkJgUmr+5j+LWB0cboeY5cMxWHbDp0HSj1KYtRwWx6iPMjw/9NN+DguCL3XUWD4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=r0eHG3lS; 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="r0eHG3lS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7CA6C4CEF7; Tue, 17 Mar 2026 12:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773752000; bh=5z6+ur2AWx/RXwWHSspZnMyX6cci75dluyiHroliPAY=; h=Subject:To:Cc:From:Date:From; b=r0eHG3lSrGUzFzfaj3LAkN0pLRrmcidToGk2u7orFZa88lcqLLBEP48bsYlDy60wT Mfv0DkPfHUxwNbsvyf3kxiWCpUlGndsNUxUGDSuxVgvys9OgI6F57aKkXTS0ZGBfpl plapXBXW6ZgzFIbjmlamCw+uxNzQ1OL6xblpdJZo= Subject: FAILED: patch "[PATCH] crypto: atmel-sha204a - Fix OOM ->tfm_count leak" failed to apply to 6.1-stable tree To: thorsten.blum@linux.dev,herbert@gondor.apana.org.au Cc: From: Date: Tue, 17 Mar 2026 13:53:01 +0100 Message-ID: <2026031701-universal-rotten-1b11@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 d240b079a37e90af03fd7dfec94930eb6c83936e # git commit -s git send-email --to '' --in-reply-to '2026031701-universal-rotten-1b11@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From d240b079a37e90af03fd7dfec94930eb6c83936e Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Thu, 19 Feb 2026 00:54:00 +0100 Subject: [PATCH] crypto: atmel-sha204a - Fix OOM ->tfm_count leak If memory allocation fails, decrement ->tfm_count to avoid blocking future reads. Cc: stable@vger.kernel.org Fixes: da001fb651b0 ("crypto: atmel-i2c - add support for SHA204A random number generator") Signed-off-by: Thorsten Blum Signed-off-by: Herbert Xu diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c index 8adc7fe71c04..98d1023007e3 100644 --- a/drivers/crypto/atmel-sha204a.c +++ b/drivers/crypto/atmel-sha204a.c @@ -52,9 +52,10 @@ static int atmel_sha204a_rng_read_nonblocking(struct hwrng *rng, void *data, rng->priv = 0; } else { work_data = kmalloc_obj(*work_data, GFP_ATOMIC); - if (!work_data) + if (!work_data) { + atomic_dec(&i2c_priv->tfm_count); return -ENOMEM; - + } work_data->ctx = i2c_priv; work_data->client = i2c_priv->client;