OpenCloudOS-Kernel/drivers/thunderbolt
Mathias Nyman 22c7a18ed5 thunderbolt: usb4: Fix NVM read buffer bounds and offset issue
Up to 64 bytes of data can be read from NVM in one go.
Read address must be dword aligned. Data is read into a local buffer.

If caller asks to read data starting at an unaligned address then full
dword is anyway read from NVM into a local buffer. Data is then copied
from the local buffer starting at the unaligned offset to the caller
buffer.

In cases where asked data length + unaligned offset is over 64 bytes
we need to make sure we don't read past the 64 bytes in the local
buffer when copying to caller buffer, and make sure that we don't
skip copying unaligned offset bytes from local buffer anymore after
the first round of 64 byte NVM data read.

Fixes: b04079837b ("thunderbolt: Add initial support for USB4")
Cc: stable@vger.kernel.org
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2021-05-20 11:52:58 +03:00
..
Kconfig thunderbolt: Add DMA traffic test driver 2020-11-11 10:20:16 +03:00
Makefile thunderbolt: Add DMA traffic test driver 2020-11-11 10:20:16 +03:00
acpi.c thunderbolt: Changes for v5.12 merge window 2021-02-09 13:00:07 +01:00
cap.c thunderbolt: cap: Fix kernel-doc formatting issue 2021-01-28 12:33:18 +03:00
ctl.c thunderbolt: Decrease control channel timeout for software connection manager 2021-03-18 18:25:30 +03:00
ctl.h thunderbolt: Decrease control channel timeout for software connection manager 2021-03-18 18:25:30 +03:00
debugfs.c thunderbolt: debugfs: Show all accessible dwords 2021-03-12 13:13:34 +03:00
dma_port.c thunderbolt: dma_port: Fix NVM read buffer bounds and offset issue 2021-05-20 11:52:52 +03:00
dma_port.h thunderbolt: Convert rest of the driver files to use SPDX identifier 2018-10-02 15:52:08 -07:00
dma_test.c thunderbolt: Allow multiple DMA tunnels over a single XDomain connection 2021-03-18 18:25:31 +03:00
domain.c thunderbolt: Unlock on error path in tb_domain_add() 2021-03-23 17:09:34 +03:00
eeprom.c thunderbolt: Add support for USB4 DROM 2021-03-18 18:25:32 +03:00
icm.c thunderbolt: Allow multiple DMA tunnels over a single XDomain connection 2021-03-18 18:25:31 +03:00
lc.c thunderbolt: Start lane initialization after sleep 2021-01-11 17:15:42 +03:00
nhi.c thunderbolt: Add support for native USB4 _OSC 2021-02-04 10:45:25 +03:00
nhi.h thunderbolt: Changes for v5.11 merge window 2020-12-08 13:41:45 +01:00
nhi_ops.c thunderbolt: Software CM only should set force power in Tiger Lake 2020-09-03 12:06:40 +03:00
nhi_regs.h thunderbolt: Add support for Intel Ice Lake 2019-08-26 12:15:06 +03:00
nvm.c thunderbolt: Add support for separating the flush to SPI and authenticate 2020-07-01 13:51:49 +03:00
path.c thunderbolt: path: Fix kernel-doc descriptions of non-static functions 2021-02-04 10:38:37 +03:00
property.c thunderbolt: Add tb_property_copy_dir() 2021-03-18 18:25:31 +03:00
quirks.c thunderbolt: Correct tb_check_quirks() kernel-doc 2020-09-16 14:57:46 +03:00
retimer.c thunderbolt: Fix off by one in tb_port_find_retimer() 2021-03-30 13:38:10 +03:00
sb_regs.h thunderbolt: Add support for on-board retimers 2020-06-22 19:58:32 +03:00
switch.c thunderbolt: Changes for v5.13 merge window 2021-04-13 12:17:14 +02:00
tb.c thunderbolt: Changes for v5.13 merge window 2021-04-13 12:17:14 +02:00
tb.h thunderbolt: Allow multiple DMA tunnels over a single XDomain connection 2021-03-18 18:25:31 +03:00
tb_msgs.h thunderbolt: Add USB4 router operation proxy for firmware connection manager 2020-11-30 14:39:24 +03:00
tb_regs.h thunderbolt: Start lane initialization after sleep 2021-01-11 17:15:42 +03:00
test.c thunderbolt: Add KUnit tests for DMA tunnels 2021-03-18 18:25:32 +03:00
tmu.c thunderbolt: Add support for Time Management Unit 2019-12-18 15:41:15 +01:00
tunnel.c thunderbolt: Allow multiple DMA tunnels over a single XDomain connection 2021-03-18 18:25:31 +03:00
tunnel.h thunderbolt: Allow multiple DMA tunnels over a single XDomain connection 2021-03-18 18:25:31 +03:00
usb4.c thunderbolt: usb4: Fix NVM read buffer bounds and offset issue 2021-05-20 11:52:58 +03:00
xdomain.c thunderbolt: Allow multiple DMA tunnels over a single XDomain connection 2021-03-18 18:25:31 +03:00