2021-05-26 02:39:49

by Tedd Ho-Jeong An

[permalink] [raw]
Subject: [PATCH] Bluetooth: Fix get device flags command returns garbage parameter

From: Tedd Ho-Jeong An <[email protected]>

This patch memset the response parameter so it doesn't return the garbage
value when the Get Device Flags command fails.

Signed-off-by: Tedd Ho-Jeong An <[email protected]>
---
net/bluetooth/mgmt.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index b44e19c69c44..91d36c3bf23e 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -4061,6 +4061,8 @@ static int get_device_flags(struct sock *sk, struct hci_dev *hdev, void *data,

hci_dev_lock(hdev);

+ memset(&rp, 0, sizeof(rp));
+
if (cp->addr.type == BDADDR_BREDR) {
br_params = hci_bdaddr_list_lookup_with_flags(&hdev->whitelist,
&cp->addr.bdaddr,
--
2.26.3


2021-05-26 03:04:02

by bluez.test.bot

[permalink] [raw]
Subject: RE: Bluetooth: Fix get device flags command returns garbage parameter

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=488503

---Test result---

Test Summary:
CheckPatch PASS 0.90 seconds
GitLint PASS 0.13 seconds
BuildKernel PASS 654.85 seconds
TestRunner: Setup PASS 433.41 seconds
TestRunner: l2cap-tester PASS 3.03 seconds
TestRunner: bnep-tester PASS 2.13 seconds
TestRunner: mgmt-tester PASS 29.25 seconds
TestRunner: rfcomm-tester PASS 2.36 seconds
TestRunner: sco-tester PASS 2.28 seconds
TestRunner: smp-tester PASS 2.44 seconds
TestRunner: userchan-tester PASS 2.12 seconds

Details
##############################
Test: CheckPatch - PASS - 0.90 seconds
Run checkpatch.pl script with rule in .checkpatch.conf


##############################
Test: GitLint - PASS - 0.13 seconds
Run gitlint with rule in .gitlint


##############################
Test: BuildKernel - PASS - 654.85 seconds
Build Kernel with minimal configuration supports Bluetooth


##############################
Test: TestRunner: Setup - PASS - 433.41 seconds
Setup environment for running Test Runner


##############################
Test: TestRunner: l2cap-tester - PASS - 3.03 seconds
Run test-runner with l2cap-tester
Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: bnep-tester - PASS - 2.13 seconds
Run test-runner with bnep-tester
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: mgmt-tester - PASS - 29.25 seconds
Run test-runner with mgmt-tester
Total: 427, Passed: 412 (96.5%), Failed: 0, Not Run: 15

##############################
Test: TestRunner: rfcomm-tester - PASS - 2.36 seconds
Run test-runner with rfcomm-tester
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: sco-tester - PASS - 2.28 seconds
Run test-runner with sco-tester
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: smp-tester - PASS - 2.44 seconds
Run test-runner with smp-tester
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: userchan-tester - PASS - 2.12 seconds
Run test-runner with userchan-tester
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0



---
Regards,
Linux Bluetooth


Attachments:
l2cap-tester.log (43.31 kB)
bnep-tester.log (3.47 kB)
mgmt-tester.log (547.30 kB)
rfcomm-tester.log (11.40 kB)
sco-tester.log (9.68 kB)
smp-tester.log (11.55 kB)
userchan-tester.log (5.33 kB)
Download all attachments

2021-05-26 15:05:14

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Fix get device flags command returns garbage parameter

Hi Tedd,

> This patch memset the response parameter so it doesn't return the garbage
> value when the Get Device Flags command fails.
>

please add a Fixes: tag here.

Regards

Marcel