net: lantiq: fix memory corruption in RX ring
authorAleksander Jan Bajkowski <olek2@wp.pl>
Fri, 21 May 2021 14:45:58 +0000 (16:45 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 May 2021 21:19:40 +0000 (14:19 -0700)
commitc7718ee96dbc2f9c5fc3b578abdf296dd44b9c20
tree5e9baa412bfd7615fdf2dac6722001820f831caf
parentfc516d3a6aa2c6ffe27d0da8818d13839e023e7e
net: lantiq: fix memory corruption in RX ring

In a situation where memory allocation or dma mapping fails, an
invalid address is programmed into the descriptor. This can lead
to memory corruption. If the memory allocation fails, DMA should
reuse the previous skb and mapping and drop the packet. This patch
also increments rx drop counter.

Fixes: fe1a56420cf2 ("net: lantiq: Add Lantiq / Intel VRX200 Ethernet driver ")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/lantiq_xrx200.c