linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle()
@ 2021-10-15 22:50 Soenke Huster
  2021-10-19  0:12 ` bluez.test.bot
  2021-10-19 18:30 ` [PATCH] " Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Soenke Huster @ 2021-10-15 22:50 UTC (permalink / raw)
  To: soenke.huster
  Cc: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
	linux-bluetooth, linux-kernel

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@eknoes.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);
 	}
 }
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle()
  2021-10-15 22:50 [PATCH] Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle() Soenke Huster
@ 2021-10-19  0:12 ` bluez.test.bot
  2021-10-19 18:30 ` [PATCH] " Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2021-10-19  0:12 UTC (permalink / raw)
  To: linux-bluetooth, soenke.huster

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=564589

---Test result---

Test Summary:
CheckPatch                    PASS      1.68 seconds
GitLint                       PASS      0.92 seconds
BuildKernel                   PASS      678.86 seconds
TestRunner: Setup             PASS      491.31 seconds
TestRunner: l2cap-tester      PASS      10.89 seconds
TestRunner: bnep-tester       PASS      5.84 seconds
TestRunner: mgmt-tester       PASS      100.55 seconds
TestRunner: rfcomm-tester     PASS      7.19 seconds
TestRunner: sco-tester        PASS      7.51 seconds
TestRunner: smp-tester        PASS      7.19 seconds
TestRunner: userchan-tester   PASS      6.11 seconds



---
Regards,
Linux Bluetooth


[-- Attachment #2: l2cap-tester.log --]
[-- Type: application/octet-stream, Size: 44357 bytes --]

[-- Attachment #3: bnep-tester.log --]
[-- Type: application/octet-stream, Size: 3564 bytes --]

[-- Attachment #4: mgmt-tester.log --]
[-- Type: application/octet-stream, Size: 646011 bytes --]

[-- Attachment #5: rfcomm-tester.log --]
[-- Type: application/octet-stream, Size: 11684 bytes --]

[-- Attachment #6: sco-tester.log --]
[-- Type: application/octet-stream, Size: 13923 bytes --]

[-- Attachment #7: smp-tester.log --]
[-- Type: application/octet-stream, Size: 11830 bytes --]

[-- Attachment #8: userchan-tester.log --]
[-- Type: application/octet-stream, Size: 6372 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle()
  2021-10-15 22:50 [PATCH] Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle() Soenke Huster
  2021-10-19  0:12 ` bluez.test.bot
@ 2021-10-19 18:30 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2021-10-19 18:30 UTC (permalink / raw)
  To: Soenke Huster
  Cc: Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth, linux-kernel

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@eknoes.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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-19 18:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15 22:50 [PATCH] Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle() Soenke Huster
2021-10-19  0:12 ` bluez.test.bot
2021-10-19 18:30 ` [PATCH] " Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).