linux_dsm_epyc7002/drivers
Jarkko Sakkinen 3d7a850fdc tpm/tpm_crb: Avoid unaligned reads in crb_recv()
The current approach to read first 6 bytes from the response and then tail
of the response, can cause the 2nd memcpy_fromio() to do an unaligned read
(e.g. read 32-bit word from address aligned to a 16-bits), depending on how
memcpy_fromio() is implemented. If this happens, the read will fail and the
memory controller will fill the read with 1's.

This was triggered by 170d13ca3a, which should be probably refined to
check and react to the address alignment. Before that commit, on x86
memcpy_fromio() turned out to be memcpy(). By a luck GCC has done the right
thing (from tpm_crb's perspective) for us so far, but we should not rely on
that. Thus, it makes sense to fix this also in tpm_crb, not least because
the fix can be then backported to stable kernels and make them more robust
when compiled in differing environments.

Cc: stable@vger.kernel.org
Cc: James Morris <jmorris@namei.org>
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Jerry Snitselaar <jsnitsel@redhat.com>
Fixes: 30fc8d138e ("tpm: TPM 2.0 CRB Interface")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
2019-02-08 23:13:02 +02:00
..
accessibility
acpi libnvdimm v5.0-rc3 2019-01-20 10:24:30 +12:00
amba
android
ata ata: pata_acpi: Make PCI dependency explicit 2019-01-15 23:16:34 +01:00
atm atm: he: fix sign-extension overflow on large shift 2019-01-17 11:27:00 -08:00
auxdisplay
base regmap: Fixes for v5.0 2019-01-19 07:17:19 +12:00
bcma
block for-linus-20190118 2019-01-20 09:12:50 +12:00
bluetooth
bus
cdrom
char tpm/tpm_crb: Avoid unaligned reads in crb_recv() 2019-02-08 23:13:02 +02:00
clk
clocksource
connector
cpufreq Merge branches 'pm-cpuidle', 'pm-cpufreq' and 'pm-sleep' 2019-01-11 10:09:51 +01:00
cpuidle
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-01-19 05:48:43 +12:00
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware
fmc
fpga
fsi
gnss
gpio gpio: pca953x: Make symbol 'pca953x_i2c_regmap' static 2019-01-11 09:16:40 +01:00
gpu ACPI fixes for 5.0-rc3 2019-01-19 05:46:00 +12:00
hid
hsi
hv
hwmon hwmon: (tmp421) Correct the misspelling of the tmp442 compatible attribute in OF device ID table 2019-01-17 12:54:52 -08:00
hwspinlock
hwtracing
i2c i2c: tegra: Fix Maximum transfer size 2019-01-11 00:15:04 +01:00
i3c i3c: master: dw-i3c-master: fix i3c_attach/reattach 2019-01-15 11:15:11 +01:00
ide
idle
iio - New Device Support 2019-01-15 06:24:36 +12:00
infiniband First 5.0 rc pull request 2019-01-18 17:17:20 +12:00
input
iommu
ipack
irqchip irqchip/csky: fixup handle_irq_perbit break irq 2019-01-09 00:18:46 +08:00
isdn isdn: avm: Fix string plus integer warning from Clang 2019-01-19 10:01:03 -08:00
leds leds: lp5523: fix a missing check of return value of lp55xx_read 2019-01-17 22:27:39 +01:00
lightnvm
macintosh
mailbox
mcb
md md: Make bio_alloc_mddev use bio_alloc_bioset 2019-01-14 06:31:56 -07:00
media media: vim2m: only cancel work if it is for right context 2019-01-16 11:13:25 -05:00
memory
memstick
message
mfd - New Device Support 2019-01-15 06:24:36 +12:00
misc virtio: don't allocate vqs when names[i] = NULL 2019-01-14 20:15:19 -05:00
mmc GPIO fixes for the v5.0 series: 2019-01-15 06:26:28 +12:00
mtd mtd: rawnand: denali: get ->setup_data_interface() working again 2019-01-18 10:27:01 +01:00
mux
net virtio_net: bulk free tx skbs 2019-01-19 16:06:52 -08:00
nfc
ntb
nubus
nvdimm libnvdimm/security: Fix nvdimm_security_state() state request selection 2019-01-15 13:54:33 -08:00
nvme for-linus-20190118 2019-01-20 09:12:50 +12:00
nvmem
of OF: properties: add missing of_node_put 2019-01-16 12:49:53 -06:00
opp
oprofile
parisc
parport
pci pci-v5.0-fixes-2 2019-01-19 07:26:16 +12:00
pcmcia
perf
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
pinctrl
platform platform/x86: apple-gmux: Make PCI dependency explicit 2019-01-15 23:17:16 +01:00
pnp
power
powercap
pps
ps3
ptp ptp: check that rsv field is zero in struct ptp_sys_offset_extended 2019-01-08 16:22:56 -05:00
pwm
rapidio
ras
regulator
remoteproc virtio: don't allocate vqs when names[i] = NULL 2019-01-14 20:15:19 -05:00
reset
rpmsg
rtc
s390 virtio: don't allocate vqs when names[i] = NULL 2019-01-14 20:15:19 -05:00
sbus
scsi SCSI fixes on 20190118 2019-01-20 09:15:04 +12:00
sfi
sh
siox
slimbus
sn
soc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
soundwire
spi
spmi
ssb
staging Staging driver fixes for 5.0-rc2 2019-01-14 05:49:35 +12:00
target scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes 2019-01-11 20:58:52 -05:00
tc
tee
thermal drivers: thermal: int340x_thermal: Make PCI dependency explicit 2019-01-15 23:17:40 +01:00
thunderbolt
tty tty/serial fixes for 5.0-rc2 2019-01-14 05:47:48 +12:00
uio
usb USB fixes for 5.0-rc2 2019-01-14 05:45:28 +12:00
uwb
vfio vfio/type1: Fix unmap overflow off-by-one 2019-01-08 09:31:28 -07:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-21 12:52:31 +13:00
video fbdev fixes for v5.0-rc3: 2019-01-19 05:43:05 +12:00
virt
virtio virtio-balloon: tweak config_changed implementation 2019-01-14 20:15:20 -05:00
visorbus
vlynq
vme
w1
watchdog
xen xen: fixes for 5.0-rc3 2019-01-19 05:53:41 +12:00
zorro
Kconfig
Makefile