]> 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)
commit4d85361b36884a6b53df0aec48376427ee2c38d9
tree5e9baa412bfd7615fdf2dac6722001820f831caf
parent337d00a22c4d9b8873038fd0cbd32a08904758cd
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: 2db54a9ba722 ("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