linux-stable/drivers/char
Jonas Gorski 48235635ab hwrng: geode - fix accessing registers
[ Upstream commit 464bd8ec2f ]

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: 9f6ec8dc57 ("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>
2023-11-20 10:27:34 +01:00
..
agp parisc: sba: Fix compile warning wrt list of SBA devices 2023-10-10 21:43:39 +02:00
hw_random hwrng: geode - fix accessing registers 2023-11-20 10:27:34 +01:00
ipmi ipmi: fix memleak when unload ipmi driver 2023-01-18 09:26:30 +01:00
mwave char/mwave: Adjust io port register size 2022-01-27 09:00:52 +01:00
pcmcia char: pcmcia: error out if 'num_bytes_read' is greater than 4 in set_protocol() 2021-07-20 16:17:40 +02:00
tpm tpm_tis: Resend command to recover from data transfer errors 2023-09-23 10:47:04 +02:00
xilinx_hwicap
xillybus
Kconfig random: credit cpu and bootloader seeds by default 2022-06-25 11:46:43 +02:00
Makefile
apm-emulation.c
applicom.c applicom: Fix potential Spectre v1 vulnerabilities 2019-03-13 14:03:10 -07:00
applicom.h
bfin-otp.c
bsr.c
ds1302.c
ds1620.c
dsp56k.c
dtlk.c
efirtc.c
generic_nvram.c
hangcheck-timer.c
hpet.c char: hpet: add checks after calling ioremap 2021-06-03 08:36:21 +02:00
lp.c
mbcs.c
mbcs.h
mem.c random: restore O_NONBLOCK support 2022-10-26 13:16:54 +02:00
misc.c
mspec.c
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c
ppdev.c ppdev: fix PPGETTIME/PPSETTIME ioctls 2019-12-17 20:39:39 +01:00
ps3flash.c
random.c random: use expired timer rather than wq for mixing fast pool 2022-10-26 13:16:54 +02:00
raw.c
rtc.c
scx200_gpio.c
snsc.c
snsc.h
snsc_event.c
sonypi.c
tb0219.c
tile-srom.c
tlclk.c drivers: char: tlclk.c: Avoid data race between init and interrupt handler 2020-10-01 13:12:42 +02:00
toshiba.c
ttyprintk.c ttyprintk: Add TTY hangup callback. 2021-05-22 10:57:30 +02:00
uv_mmtimer.c
virtio_console.c virtio_console: eliminate anonymous module_init & module_exit 2022-04-20 09:08:28 +02:00