kernel_samsung_a53x/drivers/char/hw_random
Jonas Gorski c84f60ba2e hwrng: geode - fix accessing registers
[ Upstream commit 464bd8ec2f06707f3773676a1bd2c64832a3c805 ]

When the membase and pci_dev pointer were moved to a new struct in priv,
the actual membase users were left untouched, and they started reading
out arbitrary memory behind the struct instead of registers. This
unfortunately turned the RNG into a constant number generator, depending
on the content of what was at that offset.

To fix this, update geode_rng_data_{read,present}() to also get the
membase via amd_geode_priv, and properly read from the right addresses
again.

Fixes: 9f6ec8dc574e ("hwrng: geode - Fix PCI device refcount leak")
Reported-by: Timur I. Davletshin <timur.davletshin@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217882
Tested-by: Timur I. Davletshin <timur.davletshin@gmail.com>
Suggested-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 11:43:02 +01:00
..
amd-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atmel-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ba431-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm2835-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cavium-rng-vf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cavium-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cctrng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cctrng.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos-trng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exyswd-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
geode-rng.c hwrng: geode - fix accessing registers 2024-11-18 11:43:02 +01:00
hisi-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hisi-trng-v2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imx-rngc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ingenic-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ingenic-trng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
intel-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iproc-rng200.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ixp4xx-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ks-sa-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
meson-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mtk-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mxc-rnga.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
n2-asm.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
n2-drv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
n2rng.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nomadik-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
npcm-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
octeon-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
omap-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
omap3-rom-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
optee-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pasemi-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pic32-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
powernv-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pseries-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s390-trng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
st-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stm32-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
timeriomem-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tx4939-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
via-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
virtio-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xgene-rng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xiphera-trng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00