* [PATCH] Bluetooth: btwilink: Fix unexpected skb free
@ 2017-05-23 9:51 Loic Poulain
2017-05-23 14:21 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Loic Poulain @ 2017-05-23 9:51 UTC (permalink / raw)
To: marcel; +Cc: dan.carpenter, linux-bluetooth, Loic Poulain
The caller (hci_core) still owns the skb in case of error, releasing
it inside the send function can lead to use-after-free errors.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Loic Poulain <loic.poulain@intel.com>
---
drivers/bluetooth/btwilink.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c
index b6bb58c..85a3978 100644
--- a/drivers/bluetooth/btwilink.c
+++ b/drivers/bluetooth/btwilink.c
@@ -262,7 +262,6 @@ static int ti_st_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
pkt_type = hci_skb_pkt_type(skb);
len = hst->st_write(skb);
if (len < 0) {
- kfree_skb(skb);
BT_ERR("ST write failed (%ld)", len);
/* Try Again, would only fail if UART has gone bad */
return -EAGAIN;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: btwilink: Fix unexpected skb free
2017-05-23 9:51 [PATCH] Bluetooth: btwilink: Fix unexpected skb free Loic Poulain
@ 2017-05-23 14:21 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2017-05-23 14:21 UTC (permalink / raw)
To: Loic Poulain; +Cc: dan.carpenter, linux-bluetooth
Hi Loic,
> The caller (hci_core) still owns the skb in case of error, releasing
> it inside the send function can lead to use-after-free errors.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Loic Poulain <loic.poulain@intel.com>
> ---
> drivers/bluetooth/btwilink.c | 1 -
> 1 file changed, 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-23 14:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-23 9:51 [PATCH] Bluetooth: btwilink: Fix unexpected skb free Loic Poulain
2017-05-23 14:21 ` Marcel Holtmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.