Skip to content

Commit 540dc76

Browse files
net: atm: fix use after free in lec_send()
jira VULN-56262 cve CVE-2025-22004 commit-author Dan Carpenter <[email protected]> commit f3009d0 The ->send() operation frees skb so save the length before calling ->send() to avoid a use after free. Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]> (cherry picked from commit f3009d0) Signed-off-by: Pratham Patel <[email protected]>
1 parent 50258d0 commit 540dc76

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/atm/lec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static void
180180
lec_send(struct atm_vcc *vcc, struct sk_buff *skb)
181181
{
182182
struct net_device *dev = skb->dev;
183+
unsigned int len = skb->len;
183184

184185
ATM_SKB(skb)->vcc = vcc;
185186
atm_account_tx(vcc, skb);
@@ -190,7 +191,7 @@ lec_send(struct atm_vcc *vcc, struct sk_buff *skb)
190191
}
191192

192193
dev->stats.tx_packets++;
193-
dev->stats.tx_bytes += skb->len;
194+
dev->stats.tx_bytes += len;
194195
}
195196

196197
static void lec_tx_timeout(struct net_device *dev, unsigned int txqueue)

0 commit comments

Comments
 (0)