mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-14 06:35:12 +00:00
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: c3e6b2c35b
("net: lantiq_xrx200: add ingress SG DMA support")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e0058f0fa8
commit
dd830aed23
1 changed files with 1 additions and 1 deletions
|
@ -260,9 +260,9 @@ static int xrx200_hw_receive(struct xrx200_chan *ch)
|
|||
|
||||
if (ctl & LTQ_DMA_EOP) {
|
||||
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_bytes += ch->skb_head->len;
|
||||
netif_receive_skb(ch->skb_head);
|
||||
ch->skb_head = NULL;
|
||||
ch->skb_tail = NULL;
|
||||
ret = XRX200_DMA_PACKET_COMPLETE;
|
||||
|
|
Loading…
Reference in a new issue