net: stmmac: use correct DMA buffer size in the RX descriptor
authorAaro Koskinen <aaro.koskinen@nokia.com>
Wed, 27 Mar 2019 20:35:35 +0000 (22:35 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 31 Mar 2019 21:00:58 +0000 (14:00 -0700)
commit583e6361414903c5206258a30e5bd88cb03c0254
tree5ec09545ea7f23e777609b40c7e3593408deb0c5
parent288ac524cf70a8e7ed851a61ed2a9744039dae8d
net: stmmac: use correct DMA buffer size in the RX descriptor

We always program the maximum DMA buffer size into the receive descriptor,
although the allocated size may be less. E.g. with the default MTU size
we allocate only 1536 bytes. If somebody sends us a bigger frame, then
memory may get corrupted.

Fix by using exact buffer sizes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/descs_com.h
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c
drivers/net/ethernet/stmicro/stmmac/enh_desc.c
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/ethernet/stmicro/stmmac/norm_desc.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c