Skip to content

Commit d5c411b

Browse files
XidianGeneralgregkh
authored andcommitted
isdn: hisax: hfc_pci: Fix a possible concurrency use-after-free bug in HFCPCI_l1hw()
[ Upstream commit 7418e65 ] In drivers/isdn/hisax/hfc_pci.c, the functions hfcpci_interrupt() and HFCPCI_l1hw() may be concurrently executed. HFCPCI_l1hw() line 1173: if (!cs->tx_skb) hfcpci_interrupt() line 942: spin_lock_irqsave(); line 1066: dev_kfree_skb_irq(cs->tx_skb); Thus, a possible concurrency use-after-free bug may occur in HFCPCI_l1hw(). To fix these bugs, the calls to spin_lock_irqsave() and spin_unlock_irqrestore() are added in HFCPCI_l1hw(), to protect the access to cs->tx_skb. Signed-off-by: Jia-Ju Bai <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent bc51a8a commit d5c411b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/isdn/hisax/hfc_pci.c

+2
Original file line numberDiff line numberDiff line change
@@ -1169,11 +1169,13 @@ HFCPCI_l1hw(struct PStack *st, int pr, void *arg)
11691169
if (cs->debug & L1_DEB_LAPD)
11701170
debugl1(cs, "-> PH_REQUEST_PULL");
11711171
#endif
1172+
spin_lock_irqsave(&cs->lock, flags);
11721173
if (!cs->tx_skb) {
11731174
test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
11741175
st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
11751176
} else
11761177
test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
1178+
spin_unlock_irqrestore(&cs->lock, flags);
11771179
break;
11781180
case (HW_RESET | REQUEST):
11791181
spin_lock_irqsave(&cs->lock, flags);

0 commit comments

Comments
 (0)