lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 19 Oct 2021 20:30:34 +0200
From:   Marcel Holtmann <marcel@...tmann.org>
To:     Soenke Huster <soenke.huster@...oes.de>
Cc:     Johan Hedberg <johan.hedberg@...il.com>,
        Luiz Augusto von Dentz <luiz.dentz@...il.com>,
        linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Bluetooth: virtio_bt: fix memory leak in
 virtbt_rx_handle()

Hi Soenke,

> On the reception of packets with a packet type that is not processed by
> the virtbt driver, the memory of the allocated socket buffers is never
> freed. Add a default case that frees these to avoid a memory leak.
> 
> Signed-off-by: Soenke Huster <soenke.huster@...oes.de>
> ---
> drivers/bluetooth/virtio_bt.c | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c
> index 57908ce4fae8..2de0f54ada73 100644
> --- a/drivers/bluetooth/virtio_bt.c
> +++ b/drivers/bluetooth/virtio_bt.c
> @@ -202,6 +202,8 @@ 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);

I prefer that even default cases have a break;.

Regards

Marcel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ