diff options
author | Tomas Bortoli <tomasbortoli@gmail.com> | 2019-05-28 15:42:58 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-31 07:28:32 +0200 |
commit | 05b9c7b0059b4bbc2ed638891e910af0bbd7ece7 (patch) | |
tree | 8fb947ef875e7b9ba041077c71b7bdb0ff42913d /drivers | |
parent | 12fd5c11d3357b21f3bf53b717225c3ae6baee42 (diff) | |
download | linux-rt-05b9c7b0059b4bbc2ed638891e910af0bbd7ece7.tar.gz |
Bluetooth: hci_bcsp: Fix memory leak in rx_skb
[ Upstream commit 4ce9146e0370fcd573f0372d9b4e5a211112567c ]
Syzkaller found that it is possible to provoke a memory leak by
never freeing rx_skb in struct bcsp_struct.
Fix by freeing in bcsp_close()
Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
Reported-by: syzbot+98162c885993b72f19c4@syzkaller.appspotmail.com
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/bluetooth/hci_bcsp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index d880f4e33c75..57a7f4255ac0 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c @@ -757,6 +757,11 @@ static int bcsp_close(struct hci_uart *hu) skb_queue_purge(&bcsp->rel); skb_queue_purge(&bcsp->unrel); + if (bcsp->rx_skb) { + kfree_skb(bcsp->rx_skb); + bcsp->rx_skb = NULL; + } + kfree(bcsp); return 0; } |