mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
rtl818x: fix potential use after free
[ Upstream commit afbb1947db ]
entry is released via usb_put_urb just after calling usb_submit_urb.
However, entry is used if the submission fails, resulting in a use after
free bug. The patch fixes this.
Signed-off-by: Pan Bian <bianpan2016@163.com>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ad6f8fe302
commit
015510174b
@@ -446,12 +446,13 @@ static int rtl8187_init_urbs(struct ieee80211_hw *dev)
|
||||
skb_queue_tail(&priv->rx_queue, skb);
|
||||
usb_anchor_urb(entry, &priv->anchored);
|
||||
ret = usb_submit_urb(entry, GFP_KERNEL);
|
||||
usb_put_urb(entry);
|
||||
if (ret) {
|
||||
skb_unlink(skb, &priv->rx_queue);
|
||||
usb_unanchor_urb(entry);
|
||||
usb_put_urb(entry);
|
||||
goto err;
|
||||
}
|
||||
usb_put_urb(entry);
|
||||
}
|
||||
return ret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user