Message ID | b468e20424d271295c84c72059952acaf65968a5.1713002640.git.pav@iki.fi (mailing list archive) |
---|---|
State | Accepted |
Commit | b411b98bf4f51c18c77626f786a4f2b8cdc28982 |
Headers | show |
Series | [BlueZ] set: don't modify input sirk key in btd_set_add_device() | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/CheckPatch | warning | WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #103: 0x60600001c068 is located 40 bytes inside of 56-byte region [0x60600001c040,0x60600001c078) /github/workspace/src/src/13628665.patch total: 0 errors, 1 warnings, 40 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/13628665.patch has style problems, please review. NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. |
tedd_an/GitLint | fail | 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 23: B1 Line exceeds max length (91>80): "0x60600001c068 is located 40 bytes inside of 56-byte region [0x60600001c040,0x60600001c078)" |
tedd_an/BuildEll | success | Build ELL PASS |
tedd_an/BluezMake | success | Bluez Make PASS |
tedd_an/MakeCheck | success | Bluez Make Check PASS |
tedd_an/MakeDistcheck | success | Make Distcheck PASS |
tedd_an/CheckValgrind | success | Check Valgrind PASS |
tedd_an/CheckSmatch | success | CheckSparse PASS |
tedd_an/bluezmakeextell | success | Make External ELL PASS |
tedd_an/IncrementalBuild | success | Incremental Build PASS |
tedd_an/ScanBuild | success | Scan Build PASS |
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=844243 ---Test result--- Test Summary: CheckPatch FAIL 0.62 seconds GitLint FAIL 0.47 seconds BuildEll PASS 24.57 seconds BluezMake PASS 1686.19 seconds MakeCheck PASS 13.47 seconds MakeDistcheck PASS 177.72 seconds CheckValgrind PASS 247.89 seconds CheckSmatch PASS 352.18 seconds bluezmakeextell PASS 119.70 seconds IncrementalBuild PASS 1507.66 seconds ScanBuild PASS 1014.47 seconds Details ############################## Test: CheckPatch - FAIL Desc: Run checkpatch.pl script Output: [BlueZ] set: don't modify input sirk key in btd_set_add_device() WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #103: 0x60600001c068 is located 40 bytes inside of 56-byte region [0x60600001c040,0x60600001c078) /github/workspace/src/src/13628665.patch total: 0 errors, 1 warnings, 40 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/13628665.patch has style problems, please review. NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO 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: [BlueZ] set: don't modify input sirk key in btd_set_add_device() 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 23: B1 Line exceeds max length (91>80): "0x60600001c068 is located 40 bytes inside of 56-byte region [0x60600001c040,0x60600001c078)" --- Regards, Linux Bluetooth
Hello: This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Sat, 13 Apr 2024 13:04:26 +0300 you wrote: > Currently, btd_set_add_device decrypts the sirk in-place, modifying the > key passed to it. > > This causes store_sirk() later on to save the wrong (decrypted) key > value, resulting to invalid duplicate device set. > > It also allows devices->sirk list to contain same set multiple times, > which crashes later on as sirks-set are assumed to be 1-to-1 in > btd_set_add/remove_device(). > > [...] Here is the summary with links: - [BlueZ] set: don't modify input sirk key in btd_set_add_device() https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=b411b98bf4f5 You are awesome, thank you!
diff --git a/src/set.c b/src/set.c index ad64fb163..bf35ee403 100644 --- a/src/set.c +++ b/src/set.c @@ -171,7 +171,7 @@ static void set_free(void *data) } static struct btd_device_set *set_new(struct btd_device *device, - uint8_t sirk[16], uint8_t size) + const uint8_t sirk[16], uint8_t size) { struct btd_device_set *set; @@ -206,7 +206,7 @@ static struct btd_device_set *set_new(struct btd_device *device, } static struct btd_device_set *set_find(struct btd_device *device, - uint8_t sirk[16]) + const uint8_t sirk[16]) { struct btd_adapter *adapter = device_get_adapter(device); const struct queue_entry *entry; @@ -295,10 +295,14 @@ static void foreach_device(struct btd_device *device, void *data) } struct btd_device_set *btd_set_add_device(struct btd_device *device, - uint8_t *key, uint8_t sirk[16], + const uint8_t *key, + const uint8_t sirk_value[16], uint8_t size) { struct btd_device_set *set; + uint8_t sirk[16]; + + memcpy(sirk, sirk_value, sizeof(sirk)); /* In case key has been set it means SIRK is encrypted */ if (key) { diff --git a/src/set.h b/src/set.h index 67177e8c7..2307218c4 100644 --- a/src/set.h +++ b/src/set.h @@ -13,7 +13,8 @@ struct btd_device_set; struct btd_device_set *btd_set_add_device(struct btd_device *device, - uint8_t *ltk, uint8_t sirk[16], + const uint8_t *ltk, + const uint8_t sirk[16], uint8_t size); bool btd_set_remove_device(struct btd_device_set *set, struct btd_device *device);