]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit5ceeb3023448ffea3cd7ac2753024947d9e4bfcb
tree5e9baa412bfd7615fdf2dac6722001820f831caf
parent0a66c57e26e97c95eab3936b5507e0088b76c9c4
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: 462a72fd466e ("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