mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
atm: idt77252: prevent use after free in dequeue_rx()
We can't dereference "skb" after calling vcc->push() because the skb
is released.
Fixes: 1da177e4c3
("Linux-2.6.12-rc2")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
484caf2076
commit
a9a18e8f77
@ -1118,8 +1118,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
|
|||||||
rpp->len += skb->len;
|
rpp->len += skb->len;
|
||||||
|
|
||||||
if (stat & SAR_RSQE_EPDU) {
|
if (stat & SAR_RSQE_EPDU) {
|
||||||
|
unsigned int len, truesize;
|
||||||
unsigned char *l1l2;
|
unsigned char *l1l2;
|
||||||
unsigned int len;
|
|
||||||
|
|
||||||
l1l2 = (unsigned char *) ((unsigned long) skb->data + skb->len - 6);
|
l1l2 = (unsigned char *) ((unsigned long) skb->data + skb->len - 6);
|
||||||
|
|
||||||
@ -1189,14 +1189,15 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
|
|||||||
ATM_SKB(skb)->vcc = vcc;
|
ATM_SKB(skb)->vcc = vcc;
|
||||||
__net_timestamp(skb);
|
__net_timestamp(skb);
|
||||||
|
|
||||||
|
truesize = skb->truesize;
|
||||||
vcc->push(vcc, skb);
|
vcc->push(vcc, skb);
|
||||||
atomic_inc(&vcc->stats->rx);
|
atomic_inc(&vcc->stats->rx);
|
||||||
|
|
||||||
if (skb->truesize > SAR_FB_SIZE_3)
|
if (truesize > SAR_FB_SIZE_3)
|
||||||
add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
|
add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
|
||||||
else if (skb->truesize > SAR_FB_SIZE_2)
|
else if (truesize > SAR_FB_SIZE_2)
|
||||||
add_rx_skb(card, 2, SAR_FB_SIZE_2, 1);
|
add_rx_skb(card, 2, SAR_FB_SIZE_2, 1);
|
||||||
else if (skb->truesize > SAR_FB_SIZE_1)
|
else if (truesize > SAR_FB_SIZE_1)
|
||||||
add_rx_skb(card, 1, SAR_FB_SIZE_1, 1);
|
add_rx_skb(card, 1, SAR_FB_SIZE_1, 1);
|
||||||
else
|
else
|
||||||
add_rx_skb(card, 0, SAR_FB_SIZE_0, 1);
|
add_rx_skb(card, 0, SAR_FB_SIZE_0, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user