linux_dsm_epyc7002/drivers/net/wireless/rtl818x
Andrea Merello 325ed9ff14 rtl818x_pci: fix possible RX descriptor invalid data read
RX descriptor data must be read only if the descriptor has been fully
updated by HW.
There is a "ownership" flag in the descriptor itself to test this.

The driver code contains a read for the "ownership" flag and, after
it, other read access for descriptor data.

This is in DMA coherent memory, that is _not_ guaranteed to be immune
to instruction reordering, thus it is possible that the descriptor
data is read _before_ the "ownership" flag.

This can theoretically lead to a DMA/CPU race that may end up with the
driver reading the data when it is still not valid, and the "ownership"
bit just after enough time that the HW make the whole descriptor valid.
The driver will in this case believe the data is valid, but it will use
the invalid data read earlier.

In order to avoid this, this patch adds a rmb() to force the "ownership"
bit read to be issued before other descriptor data reads are attempted.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:12 -04:00
..
rtl8180 rtl818x_pci: fix possible RX descriptor invalid data read 2014-06-19 15:49:12 -04:00
rtl8187 rtl8187: make CTS-to-self protection work 2014-05-07 16:08:09 -04:00
Kconfig rtl818x: Update Kconfig for rtl8187se 2014-03-27 14:20:10 -04:00
Makefile
rtl818x.h rtl8180: add parentheses to REG_ADDR macros 2014-04-22 15:06:27 -04:00