Bluetooth: Fix invalid-free in bcsp_close()
authorTomas Bortoli <tomasbortoli@gmail.com>
Fri, 1 Nov 2019 20:42:44 +0000 (21:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Dec 2019 08:14:15 +0000 (09:14 +0100)
commit79d404a2aa86efe4f1ade51e054318bd811cce71
treef8071e38c65ba101654d606d1d29a9ee8bf7b5e2
parent23ec01fdb1c3b9c6c4bf8399f74bb6e297e640e8
Bluetooth: Fix invalid-free in bcsp_close()

commit cf94da6f502d8caecabd56b194541c873c8a7a3c upstream.

Syzbot reported an invalid-free that I introduced fixing a memleak.

bcsp_recv() also frees bcsp->rx_skb but never nullifies its value.
Nullify bcsp->rx_skb every time it is freed.

Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
Reported-by: syzbot+a0d209a4676664613e76@syzkaller.appspotmail.com
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: Alexander Potapenko <glider@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bluetooth/hci_bcsp.c