lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 0092/1039] Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle()
    Date
    From: Soenke Huster <soenke.huster@eknoes.de>

    [ Upstream commit 1d0688421449718c6c5f46e458a378c9b530ba18 ]

    On the reception of packets with an invalid packet type, the memory of
    the allocated socket buffers is never freed. Add a default case that frees
    these to avoid a memory leak.

    Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver")
    Signed-off-by: Soenke Huster <soenke.huster@eknoes.de>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/bluetooth/virtio_bt.c | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c
    index 57908ce4fae85..076e4942a3f0e 100644
    --- a/drivers/bluetooth/virtio_bt.c
    +++ b/drivers/bluetooth/virtio_bt.c
    @@ -202,6 +202,9 @@ static void virtbt_rx_handle(struct virtio_bluetooth *vbt, struct sk_buff *skb)
    hci_skb_pkt_type(skb) = pkt_type;
    hci_recv_frame(vbt->hdev, skb);
    break;
    + default:
    + kfree_skb(skb);
    + break;
    }
    }

    --
    2.34.1


    \
     
     \ /
      Last update: 2022-01-24 23:09    [W:2.472 / U:0.908 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site