All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return
@ 2021-04-09 16:53 Colin King
  2021-04-09 17:32 ` [next] " bluez.test.bot
  2021-04-11 11:56 ` [PATCH][next] " Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-04-09 16:53 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The call to alloc_skb with the GFP_KERNEL flag can return a null sk_buff
pointer, so add a null check to avoid any null pointer deference issues.

Addresses-Coverity: ("Dereference null return value")
Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 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 c804db7e90f8..5f82574236c0 100644
--- a/drivers/bluetooth/virtio_bt.c
+++ b/drivers/bluetooth/virtio_bt.c
@@ -34,6 +34,8 @@ static int virtbt_add_inbuf(struct virtio_bluetooth *vbt)
 	int err;
 
 	skb = alloc_skb(1000, GFP_KERNEL);
+	if (!skb)
+		return -ENOMEM;
 	sg_init_one(sg, skb->data, 1000);
 
 	err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_KERNEL);
-- 
2.30.2


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

* RE: [next] Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return
  2021-04-09 16:53 [PATCH][next] Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return Colin King
@ 2021-04-09 17:32 ` bluez.test.bot
  2021-04-11 11:56 ` [PATCH][next] " Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2021-04-09 17:32 UTC (permalink / raw)
  To: linux-bluetooth, colin.king

[-- Attachment #1: Type: text/plain, Size: 2812 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=464573

---Test result---

##############################
Test: CheckPatch - FAIL
Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return
WARNING: Unknown commit id 'afd2daa26c7a', maybe rebased or not pulled?
#11: 
Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver")

total: 0 errors, 1 warnings, 8 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH] Bluetooth: virtio_bt: add missing null pointer check on" has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: CheckGitLint - FAIL
Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return
1: T1 Title exceeds max length (77>72): "Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return"


##############################
Test: CheckBuildK - PASS


##############################
Test: CheckTestRunner: Setup - PASS


##############################
Test: CheckTestRunner: l2cap-tester - PASS
Total: 40, Passed: 34 (85.0%), Failed: 0, Not Run: 6

##############################
Test: CheckTestRunner: bnep-tester - PASS
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: mgmt-tester - FAIL
Total: 416, Passed: 396 (95.2%), Failed: 6, Not Run: 14

Failed Test Cases
Set connectable off (LE) - Success 2                 Failed       0.020 seconds
Set connectable off (LE) - Success 3                 Failed       0.024 seconds
Set connectable off (LE) - Success 4                 Failed       0.024 seconds
Add Advertising - Success 13 (ADV_SCAN_IND)          Failed       0.024 seconds
Add Advertising - Success 14 (ADV_NONCONN_IND)       Failed       0.020 seconds
Add Advertising - Success 17 (Connectable -> off)    Failed       0.020 seconds

##############################
Test: CheckTestRunner: rfcomm-tester - PASS
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: sco-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: smp-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: userchan-tester - PASS
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0



---
Regards,
Linux Bluetooth


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

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

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

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

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

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

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

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

* Re: [PATCH][next] Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return
  2021-04-09 16:53 [PATCH][next] Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return Colin King
  2021-04-09 17:32 ` [next] " bluez.test.bot
@ 2021-04-11 11:56 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2021-04-11 11:56 UTC (permalink / raw)
  To: Colin King
  Cc: Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth,
	kernel-janitors, linux-kernel

Hi Colin,

> The call to alloc_skb with the GFP_KERNEL flag can return a null sk_buff
> pointer, so add a null check to avoid any null pointer deference issues.
> 
> Addresses-Coverity: ("Dereference null return value")
> Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/bluetooth/virtio_bt.c | 2 ++
> 1 file changed, 2 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

end of thread, other threads:[~2021-04-11 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09 16:53 [PATCH][next] Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return Colin King
2021-04-09 17:32 ` [next] " bluez.test.bot
2021-04-11 11:56 ` [PATCH][next] " Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.