Commit 5a717843 authored by Rex Chang's avatar Rex Chang Committed by David S. Miller

Net: ethernet: ti: netcp: Fix inbound ping crash if MTU size is greater than 1500

In the receive queue for 4096 bytes fragments, the page address
set in the SW data0 field of the descriptor is not the one we got
when doing the reassembly in receive. The page structure was retrieved
from the wrong descriptor into SW data0 which is then causing a
page fault when UDP checksum is accessing data above 1500.
Signed-off-by: default avatarRex Chang <rchang@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6db959c8
...@@ -715,7 +715,7 @@ static int netcp_process_one_rx_packet(struct netcp_intf *netcp) ...@@ -715,7 +715,7 @@ static int netcp_process_one_rx_packet(struct netcp_intf *netcp)
/* warning!!!! We are retrieving the virtual ptr in the sw_data /* warning!!!! We are retrieving the virtual ptr in the sw_data
* field as a 32bit value. Will not work on 64bit machines * field as a 32bit value. Will not work on 64bit machines
*/ */
page = (struct page *)GET_SW_DATA0(desc); page = (struct page *)GET_SW_DATA0(ndesc);
if (likely(dma_buff && buf_len && page)) { if (likely(dma_buff && buf_len && page)) {
dma_unmap_page(netcp->dev, dma_buff, PAGE_SIZE, dma_unmap_page(netcp->dev, dma_buff, PAGE_SIZE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment