]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
crypto: jitter - consider 32 LSB for APT
authorStephan Müller <smueller@chronox.de>
Sun, 21 Nov 2021 14:14:20 +0000 (15:14 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 10:02:29 +0000 (11:02 +0100)
commitbd4971095c55b5c146326ffda71086bbfeba0dd1
tree85250be7a3e78ac9d1914454256b2e0130ee51be
parentfb6170b0656643b8b2c1d3b69a9daceca490e82a
crypto: jitter - consider 32 LSB for APT

BugLink: https://bugs.launchpad.net/bugs/1959376
[ Upstream commit 552d03a223eda3df84526ab2c1f4d82e15eaee7a ]

The APT compares the current time stamp with a pre-set value. The
current code only considered the 4 LSB only. Yet, after reviews by
mathematicians of the user space Jitter RNG version >= 3.1.0, it was
concluded that the APT can be calculated on the 32 LSB of the time
delta. Thi change is applied to the kernel.

This fixes a bug where an AMD EPYC fails this test as its RDTSC value
contains zeros in the LSB. The most appropriate fix would have been to
apply a GCD calculation and divide the time stamp by the GCD. Yet, this
is a significant code change that will be considered for a future
update. Note, tests showed that constantly the GCD always was 32 on
these systems, i.e. the 5 LSB were always zero (thus failing the APT
since it only considered the 4 LSB for its calculation).

Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
crypto/jitterentropy.c