2023-07-17 09:42:52

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v1 1/1] Bluetooth: MGMT: Use correct address for memcpy()

In function ‘fortify_memcpy_chk’,
inlined from ‘get_conn_info_complete’ at net/bluetooth/mgmt.c:7281:2:
include/linux/fortify-string.h:592:25: error: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning]
592 | __read_overflow2_field(q_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

This is due to the wrong member is used for memcpy(). Use correct one.

Signed-off-by: Andy Shevchenko <[email protected]>
---
net/bluetooth/mgmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 33c06f7c7641..d6c9b7bc8592 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -7278,7 +7278,7 @@ static void get_conn_info_complete(struct hci_dev *hdev, void *data, int err)

bt_dev_dbg(hdev, "err %d", err);

- memcpy(&rp.addr, &cp->addr.bdaddr, sizeof(rp.addr));
+ memcpy(&rp.addr, &cp->addr, sizeof(rp.addr));

status = mgmt_status(err);
if (status == MGMT_STATUS_SUCCESS) {
--
2.40.0.1.gaa8946217a0b



2023-07-17 10:14:15

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v1,1/1] Bluetooth: MGMT: Use correct address for memcpy()

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

---Test result---

Test Summary:
CheckPatch FAIL 1.00 seconds
GitLint FAIL 0.63 seconds
SubjectPrefix PASS 0.12 seconds
BuildKernel PASS 33.07 seconds
CheckAllWarning PASS 36.51 seconds
CheckSparse PASS 41.89 seconds
CheckSmatch PASS 111.84 seconds
BuildKernel32 PASS 32.10 seconds
TestRunnerSetup PASS 486.10 seconds
TestRunner_l2cap-tester PASS 23.37 seconds
TestRunner_iso-tester PASS 44.64 seconds
TestRunner_bnep-tester PASS 10.67 seconds
TestRunner_mgmt-tester PASS 219.00 seconds
TestRunner_rfcomm-tester PASS 16.00 seconds
TestRunner_sco-tester PASS 17.03 seconds
TestRunner_ioctl-tester PASS 18.09 seconds
TestRunner_mesh-tester PASS 13.41 seconds
TestRunner_smp-tester PASS 14.44 seconds
TestRunner_userchan-tester PASS 11.17 seconds
IncrementalBuild PASS 30.70 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v1,1/1] Bluetooth: MGMT: Use correct address for memcpy()
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#70:
inlined from ‘get_conn_info_complete’ at net/bluetooth/mgmt.c:7281:2:

total: 0 errors, 1 warnings, 0 checks, 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.

/github/workspace/src/src/13315359.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

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


##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[v1,1/1] Bluetooth: MGMT: Use correct address for memcpy()

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
5: B1 Line exceeds max length (217>80): "include/linux/fortify-string.h:592:25: error: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning]"


---
Regards,
Linux Bluetooth

2023-07-17 20:02:54

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] Bluetooth: MGMT: Use correct address for memcpy()

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Mon, 17 Jul 2023 12:32:14 +0300 you wrote:
> In function ‘fortify_memcpy_chk’,
> inlined from ‘get_conn_info_complete’ at net/bluetooth/mgmt.c:7281:2:
> include/linux/fortify-string.h:592:25: error: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning]
> 592 | __read_overflow2_field(q_size_field, size);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> [...]

Here is the summary with links:
- [v1,1/1] Bluetooth: MGMT: Use correct address for memcpy()
https://git.kernel.org/bluetooth/bluetooth-next/c/75401514ef1b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html