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 40E47215060; Tue, 29 Apr 2025 16:53:55 +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=1745945636; cv=none; b=jgb/GcH1H8UYl0TgS8opCNP5pvVYp58prXFITogWG3iYkvBnKpc+bmXuANln7UfUjusRsBUgLVcBsDDRtpjcbbJ2j2OVn19bjQCJCtzqNnSSIjoHxBFq0B66in/j3uJszuUkKGmDvUswFTuwokrkD90xnTJBp1chtYXAMjKhxjg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745945636; c=relaxed/simple; bh=72iSI5YbYeJxWTYj1vjoHeb0sdGvLppmXT/U2v+Iy1I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SOisGN90hfD3hzEmbDu8nuutE+KrMprOgo2kuBxxCc089iOCP2mWivUrfxkU1aYife6m10ebllXBTLWg3kzdV7aSysyImwNtYJmUPeNrI3MYWK2GbnXNSk3DNPWyD740P3XzvYogRHwHOM53P1SAZqklHiPU6M8pFAo5rdC8Vwo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eT6AMcBx; 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="eT6AMcBx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 522E7C4CEE3; Tue, 29 Apr 2025 16:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745945635; bh=72iSI5YbYeJxWTYj1vjoHeb0sdGvLppmXT/U2v+Iy1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eT6AMcBxmRTVqK+8ISwh1QYDM74uEIMbKzGiHbOZOIz618C9+H+z8Wtjko8F0r11u SjN7u3akeXodAo1w24e2vy/MXmxsAGJwR18ePmA4LAePfbupxnE1cicHmTcyq4EdHQ BMxryVg0s1gMmzKl3tD6WJ4LL4mANm1CTz3vqDUo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Marek=20Beh=C3=BAn?= , Ard Biesheuvel , Linus Walleij , Herbert Xu Subject: [PATCH 5.4 178/179] crypto: atmel-sha204a - Set hwrng quality to lowest possible Date: Tue, 29 Apr 2025 18:41:59 +0200 Message-ID: <20250429161056.595296761@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250429161049.383278312@linuxfoundation.org> References: <20250429161049.383278312@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marek Behún commit 8006aff15516a170640239c5a8e6696c0ba18d8e upstream. According to the review by Bill Cox [1], the Atmel SHA204A random number generator produces random numbers with very low entropy. Set the lowest possible entropy for this chip just to be safe. [1] https://www.metzdowd.com/pipermail/cryptography/2014-December/023858.html Fixes: da001fb651b00e1d ("crypto: atmel-i2c - add support for SHA204A random number generator") Cc: Signed-off-by: Marek Behún Acked-by: Ard Biesheuvel Reviewed-by: Linus Walleij Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman Signed-off-by: Marek Behún --- drivers/crypto/atmel-sha204a.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/crypto/atmel-sha204a.c +++ b/drivers/crypto/atmel-sha204a.c @@ -107,7 +107,12 @@ static int atmel_sha204a_probe(struct i2 i2c_priv->hwrng.name = dev_name(&client->dev); i2c_priv->hwrng.read = atmel_sha204a_rng_read; - i2c_priv->hwrng.quality = 1024; + + /* + * According to review by Bill Cox [1], this HWRNG has very low entropy. + * [1] https://www.metzdowd.com/pipermail/cryptography/2014-December/023858.html + */ + i2c_priv->hwrng.quality = 1; ret = devm_hwrng_register(&client->dev, &i2c_priv->hwrng); if (ret)