Commit dd830aed authored by Aleksander Jan Bajkowski's avatar Aleksander Jan Bajkowski Committed by David S. Miller

net: lantiq_xrx200: fix use after free bug

The skb->len field is read after the packet is sent to the network
stack. In the meantime, skb can be freed. This patch fixes this bug.

Fixes: c3e6b2c3 ("net: lantiq_xrx200: add ingress SG DMA support")
Reported-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarAleksander Jan Bajkowski <olek2@wp.pl>
Acked-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e0058f0f
...@@ -260,9 +260,9 @@ static int xrx200_hw_receive(struct xrx200_chan *ch) ...@@ -260,9 +260,9 @@ static int xrx200_hw_receive(struct xrx200_chan *ch)
if (ctl & LTQ_DMA_EOP) { if (ctl & LTQ_DMA_EOP) {
ch->skb_head->protocol = eth_type_trans(ch->skb_head, net_dev); ch->skb_head->protocol = eth_type_trans(ch->skb_head, net_dev);
netif_receive_skb(ch->skb_head);
net_dev->stats.rx_packets++; net_dev->stats.rx_packets++;
net_dev->stats.rx_bytes += ch->skb_head->len; net_dev->stats.rx_bytes += ch->skb_head->len;
netif_receive_skb(ch->skb_head);
ch->skb_head = NULL; ch->skb_head = NULL;
ch->skb_tail = NULL; ch->skb_tail = NULL;
ret = XRX200_DMA_PACKET_COMPLETE; ret = XRX200_DMA_PACKET_COMPLETE;
......
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