* [PATCH BlueZ v4 0/4] Fix bugs found by static analysis
@ 2025-07-09 13:36 Ismagil Iskakov
2025-07-09 13:36 ` [PATCH BlueZ v4 1/4] btio: fix range validation of security level Ismagil Iskakov
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Ismagil Iskakov @ 2025-07-09 13:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ismagil Iskakov
btio: fix range validation of security level
Expression is used as an index for accessing
an array's element in function 'l2cap_set_lm'.
This expression can have value 4, which is out
of range, as indicated by a preceding
conditional expression.
profiles/audio: add nullity checks
Return value of a function 'btd_device_get_service'
is dereferenced without checking for NULL, but it
is usually checked for this function (28/35).
Return value of a function 'queue_find' is
dereferenced without checking for NULL, but it
is usually checked for this function (182/183).
src/shared: add nullity checks
Return value of a function 'util_iov_pull_mem'
is dereferenced without checking for NULL, but it
is usually checked for this function (64/80).
Return value of a function 'vcp_get_vcs' is
dereferenced without checking for NULL, but it is
usually checked for this function (4/5).
obexd/client: fix err condition causing memleak
Dynamic memory, referenced by 'err', is allocated
by calling function 'obc_transfer_get' and lost
at bip.c:139.
Ismagil Iskakov (4):
btio: fix range validation of security level
profiles/audio: add nullity checks
src/shared: add nullity checks
obexd/client: fix err condition causing memleak
btio/btio.c | 6 ++++++
obexd/client/transfer.c | 2 +-
profiles/audio/a2dp.c | 34 ++++++++++++++++++++++++----------
profiles/audio/avrcp.c | 24 +++++++++++++++++++++---
profiles/audio/bass.c | 3 +++
src/shared/bap.c | 23 +++++++++++++++++++++++
src/shared/vcp.c | 3 +++
7 files changed, 81 insertions(+), 14 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH BlueZ v4 1/4] btio: fix range validation of security level
2025-07-09 13:36 [PATCH BlueZ v4 0/4] Fix bugs found by static analysis Ismagil Iskakov
@ 2025-07-09 13:36 ` Ismagil Iskakov
2025-07-09 15:11 ` Fix bugs found by static analysis bluez.test.bot
2025-07-09 13:36 ` [PATCH BlueZ v4 2/4] profiles/audio: add nullity checks Ismagil Iskakov
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Ismagil Iskakov @ 2025-07-09 13:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ismagil Iskakov
Arrays inside l2cap_set_lm/rfcomm_set_lm functions are of size 4,
but the bounds check allows the value 4 for 'level'.
---
btio/btio.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/btio/btio.c b/btio/btio.c
index b8afe0580..bc14199f2 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -474,6 +474,12 @@ static gboolean set_sec_level(int sock, BtIOType type, int level, GError **err)
return FALSE;
}
+ if (level == BT_SECURITY_FIPS) {
+ g_set_error(err, BT_IO_ERROR, EINVAL,
+ "FIPS security level is not supported for L2CAP_LM/RFCOMM_LM");
+ return FALSE;
+ }
+
if (type == BT_IO_L2CAP)
ret = l2cap_set_lm(sock, level);
else
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* RE: Fix bugs found by static analysis
2025-07-09 13:36 ` [PATCH BlueZ v4 1/4] btio: fix range validation of security level Ismagil Iskakov
@ 2025-07-09 15:11 ` bluez.test.bot
0 siblings, 0 replies; 10+ messages in thread
From: bluez.test.bot @ 2025-07-09 15:11 UTC (permalink / raw)
To: linux-bluetooth, i.iskakov
[-- Attachment #1: Type: text/plain, Size: 1864 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=980540
---Test result---
Test Summary:
CheckPatch PENDING 0.27 seconds
GitLint PENDING 0.29 seconds
BuildEll PASS 22.59 seconds
BluezMake PASS 2749.28 seconds
MakeCheck PASS 20.24 seconds
MakeDistcheck PASS 189.54 seconds
CheckValgrind PASS 241.91 seconds
CheckSmatch WARNING 315.40 seconds
bluezmakeextell PASS 130.05 seconds
IncrementalBuild PENDING 0.32 seconds
ScanBuild PASS 909.24 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structures
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH BlueZ v4 2/4] profiles/audio: add nullity checks
2025-07-09 13:36 [PATCH BlueZ v4 0/4] Fix bugs found by static analysis Ismagil Iskakov
2025-07-09 13:36 ` [PATCH BlueZ v4 1/4] btio: fix range validation of security level Ismagil Iskakov
@ 2025-07-09 13:36 ` Ismagil Iskakov
2025-07-09 13:36 ` [PATCH BlueZ v4 3/4] src/shared: " Ismagil Iskakov
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Ismagil Iskakov @ 2025-07-09 13:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ismagil Iskakov
Cover bass_setup unsuccessful search and btd_device_get_service.
This change is motivated by the other usages where checks for
NULL exist.
---
profiles/audio/a2dp.c | 34 ++++++++++++++++++++++++----------
profiles/audio/avrcp.c | 24 +++++++++++++++++++++---
profiles/audio/bass.c | 3 +++
3 files changed, 48 insertions(+), 13 deletions(-)
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index d2c2bec65..8b0b16ff1 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -646,6 +646,18 @@ static gboolean auto_config(gpointer data)
struct btd_service *service;
struct a2dp_stream *stream;
+ dev = avdtp_get_device(setup->session);
+
+ if (setup->sep->type == AVDTP_SEP_TYPE_SOURCE)
+ service = btd_device_get_service(dev, A2DP_SINK_UUID);
+ else
+ service = btd_device_get_service(dev, A2DP_SOURCE_UUID);
+
+ if (service == NULL) {
+ error("Unable to find btd service");
+ return FALSE;
+ }
+
/* Check if configuration was aborted */
stream = queue_find(setup->sep->streams, match_stream, setup->stream);
if (!stream)
@@ -654,16 +666,12 @@ static gboolean auto_config(gpointer data)
if (setup->err != NULL)
goto done;
- dev = avdtp_get_device(setup->session);
-
avdtp_stream_add_cb(setup->session, setup->stream,
stream_state_changed, setup->sep);
if (setup->sep->type == AVDTP_SEP_TYPE_SOURCE) {
- service = btd_device_get_service(dev, A2DP_SINK_UUID);
sink_new_stream(service, setup->session, setup->stream);
} else {
- service = btd_device_get_service(dev, A2DP_SOURCE_UUID);
source_new_stream(service, setup->session, setup->stream);
}
@@ -995,10 +1003,20 @@ static void setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct btd_service *service;
int ret;
- if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
+ dev = avdtp_get_device(session);
+
+ if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK) {
DBG("Sink %p: Set_Configuration_Cfm", sep);
- else
+ service = btd_device_get_service(dev, A2DP_SOURCE_UUID);
+ } else {
DBG("Source %p: Set_Configuration_Cfm", sep);
+ service = btd_device_get_service(dev, A2DP_SINK_UUID);
+ }
+
+ if (service == NULL) {
+ error("Unable to find btd service");
+ return;
+ }
setup = find_setup_by_session(session);
@@ -1024,14 +1042,10 @@ static void setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
if (!setup)
return;
- dev = avdtp_get_device(session);
-
/* Notify D-Bus interface of the new stream */
if (a2dp_sep->type == AVDTP_SEP_TYPE_SOURCE) {
- service = btd_device_get_service(dev, A2DP_SINK_UUID);
sink_new_stream(service, session, setup->stream);
} else {
- service = btd_device_get_service(dev, A2DP_SOURCE_UUID);
source_new_stream(service, session, setup->stream);
}
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index b3e69874d..e2797112f 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -3062,8 +3062,14 @@ static void set_ct_player(struct avrcp *session, struct avrcp_player *player)
if (session->controller->player == player)
goto done;
- session->controller->player = player;
service = btd_device_get_service(session->dev, AVRCP_TARGET_UUID);
+
+ if (service == NULL) {
+ error("Unable to find btd service");
+ return;
+ }
+
+ session->controller->player = player;
control_set_player(service, player ?
media_player_get_path(player->user_data) : NULL);
@@ -4258,12 +4264,18 @@ static void target_init(struct avrcp *session)
if (session->target != NULL)
return;
+ service = btd_device_get_service(session->dev, AVRCP_REMOTE_UUID);
+
+ if (service == NULL) {
+ error("Unable to find btd service");
+ return;
+ }
+
target = data_init(session, AVRCP_REMOTE_UUID);
session->target = target;
DBG("%p version 0x%04x", target, target->version);
- service = btd_device_get_service(session->dev, AVRCP_REMOTE_UUID);
btd_service_connecting_complete(service, 0);
player = g_slist_nth_data(server->players, 0);
@@ -4312,6 +4324,13 @@ static void controller_init(struct avrcp *session)
if (session->controller != NULL)
return;
+ service = btd_device_get_service(session->dev, AVRCP_TARGET_UUID);
+
+ if (service == NULL) {
+ error("Unable to find btd service");
+ return;
+ }
+
controller = data_init(session, AVRCP_TARGET_UUID);
session->controller = controller;
@@ -4319,7 +4338,6 @@ static void controller_init(struct avrcp *session)
if (controller->obex_port)
DBG("%p OBEX PSM 0x%04x", controller, controller->obex_port);
- service = btd_device_get_service(session->dev, AVRCP_TARGET_UUID);
btd_service_connecting_complete(service, 0);
/* Only create player if category 1 is supported */
diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
index c853fbc4a..87db130da 100644
--- a/profiles/audio/bass.c
+++ b/profiles/audio/bass.c
@@ -349,6 +349,9 @@ static void bap_state_changed(struct bt_bap_stream *stream, uint8_t old_state,
struct bass_setup *setup = queue_find(dg->setups,
match_setup_stream, stream);
+ if (setup == NULL)
+ return;
+
if (dg->bap != bap)
return;
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH BlueZ v4 3/4] src/shared: add nullity checks
2025-07-09 13:36 [PATCH BlueZ v4 0/4] Fix bugs found by static analysis Ismagil Iskakov
2025-07-09 13:36 ` [PATCH BlueZ v4 1/4] btio: fix range validation of security level Ismagil Iskakov
2025-07-09 13:36 ` [PATCH BlueZ v4 2/4] profiles/audio: add nullity checks Ismagil Iskakov
@ 2025-07-09 13:36 ` Ismagil Iskakov
2025-07-09 13:36 ` [PATCH BlueZ v4 4/4] obexd/client: fix err condition causing memleak Ismagil Iskakov
2025-07-09 14:00 ` [PATCH BlueZ v4 0/4] Fix bugs found by static analysis patchwork-bot+bluetooth
4 siblings, 0 replies; 10+ messages in thread
From: Ismagil Iskakov @ 2025-07-09 13:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ismagil Iskakov
Check util_iov_pull_mem where iov len is not verified
beforehand. Check vcp_get_vcs for NULL.
These changes are based on other usages where those
checks exist.
---
src/shared/bap.c | 23 +++++++++++++++++++++++
src/shared/vcp.c | 3 +++
2 files changed, 26 insertions(+)
diff --git a/src/shared/bap.c b/src/shared/bap.c
index ba6f75ff2..8c186e6f1 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -7568,6 +7568,11 @@ bool bt_bap_parse_base(uint8_t sid, struct iovec *iov,
codec = util_iov_pull_mem(iov, sizeof(*codec));
+ if (!codec) {
+ ret = false;
+ goto done;
+ }
+
util_debug(func, NULL, "Codec: ID %d CID 0x%2.2x VID 0x%2.2x",
codec->id, codec->cid, codec->vid);
@@ -7579,6 +7584,12 @@ bool bt_bap_parse_base(uint8_t sid, struct iovec *iov,
}
l2_cc.iov_base = util_iov_pull_mem(iov, l2_cc_len);
+
+ if (!l2_cc.iov_base) {
+ ret = false;
+ goto done;
+ }
+
l2_cc.iov_len = l2_cc_len;
/* Print Codec Specific Configuration */
@@ -7593,6 +7604,12 @@ bool bt_bap_parse_base(uint8_t sid, struct iovec *iov,
}
meta.iov_base = util_iov_pull_mem(iov, meta_len);
+
+ if (!meta.iov_base) {
+ ret = false;
+ goto done;
+ }
+
meta.iov_len = meta_len;
/* Print Metadata */
@@ -7623,6 +7640,12 @@ bool bt_bap_parse_base(uint8_t sid, struct iovec *iov,
l3_cc.iov_base = util_iov_pull_mem(iov,
l3_cc_len);
+
+ if (!l3_cc.iov_base) {
+ ret = false;
+ goto done;
+ }
+
l3_cc.iov_len = l3_cc_len;
/* Print Codec Specific Configuration */
diff --git a/src/shared/vcp.c b/src/shared/vcp.c
index e614ff61f..be002ad4c 100644
--- a/src/shared/vcp.c
+++ b/src/shared/vcp.c
@@ -2934,6 +2934,9 @@ static void foreach_vcs_service(struct gatt_db_attribute *attr,
struct bt_vcp *vcp = user_data;
struct bt_vcs *vcs = vcp_get_vcs(vcp);
+ if (!vcs)
+ return;
+
vcs->service = attr;
gatt_db_service_set_claimed(attr, true);
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH BlueZ v4 4/4] obexd/client: fix err condition causing memleak
2025-07-09 13:36 [PATCH BlueZ v4 0/4] Fix bugs found by static analysis Ismagil Iskakov
` (2 preceding siblings ...)
2025-07-09 13:36 ` [PATCH BlueZ v4 3/4] src/shared: " Ismagil Iskakov
@ 2025-07-09 13:36 ` Ismagil Iskakov
2025-07-09 14:00 ` [PATCH BlueZ v4 0/4] Fix bugs found by static analysis patchwork-bot+bluetooth
4 siblings, 0 replies; 10+ messages in thread
From: Ismagil Iskakov @ 2025-07-09 13:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ismagil Iskakov
transfer_open returns 0 if an error occurs, condition corrected.
---
obexd/client/transfer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c
index a7d00896f..d8ecb60d3 100644
--- a/obexd/client/transfer.c
+++ b/obexd/client/transfer.c
@@ -556,7 +556,7 @@ struct obc_transfer *obc_transfer_get(const char *type, const char *name,
transfer = obc_transfer_create(G_OBEX_OP_GET, filename, name, type);
perr = transfer_open(transfer, O_WRONLY | O_CREAT | O_TRUNC, 0600, err);
- if (perr < 0) {
+ if (!perr) {
obc_transfer_free(transfer);
return NULL;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH BlueZ v4 0/4] Fix bugs found by static analysis
2025-07-09 13:36 [PATCH BlueZ v4 0/4] Fix bugs found by static analysis Ismagil Iskakov
` (3 preceding siblings ...)
2025-07-09 13:36 ` [PATCH BlueZ v4 4/4] obexd/client: fix err condition causing memleak Ismagil Iskakov
@ 2025-07-09 14:00 ` patchwork-bot+bluetooth
4 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+bluetooth @ 2025-07-09 14:00 UTC (permalink / raw)
To: Ismagil Iskakov; +Cc: linux-bluetooth
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Wed, 9 Jul 2025 16:36:18 +0300 you wrote:
> btio: fix range validation of security level
> Expression is used as an index for accessing
> an array's element in function 'l2cap_set_lm'.
> This expression can have value 4, which is out
> of range, as indicated by a preceding
> conditional expression.
>
> [...]
Here is the summary with links:
- [BlueZ,v4,1/4] btio: fix range validation of security level
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=80a6b91d758a
- [BlueZ,v4,2/4] profiles/audio: add nullity checks
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=77932f2dac1a
- [BlueZ,v4,3/4] src/shared: add nullity checks
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9432bfe81afd
- [BlueZ,v4,4/4] obexd/client: fix err condition causing memleak
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=09212f9d110e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH BlueZ v3 1/4] btio: fix range validation of security level
@ 2025-07-09 12:18 Ismagil Iskakov
2025-07-09 13:40 ` Fix bugs found by static analysis bluez.test.bot
0 siblings, 1 reply; 10+ messages in thread
From: Ismagil Iskakov @ 2025-07-09 12:18 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ismagil Iskakov
Arrays inside l2cap_set_lm/rfcomm_set_lm functions are of size 4,
but the bounds check allows the value 4 for 'level'.
---
btio/btio.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/btio/btio.c b/btio/btio.c
index b8afe0580..bc14199f2 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -474,6 +474,12 @@ static gboolean set_sec_level(int sock, BtIOType type, int level, GError **err)
return FALSE;
}
+ if (level == BT_SECURITY_FIPS) {
+ g_set_error(err, BT_IO_ERROR, EINVAL,
+ "FIPS security level is not supported for L2CAP_LM/RFCOMM_LM");
+ return FALSE;
+ }
+
if (type == BT_IO_L2CAP)
ret = l2cap_set_lm(sock, level);
else
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* RE: Fix bugs found by static analysis
2025-07-09 12:18 [PATCH BlueZ v3 1/4] btio: fix range validation of security level Ismagil Iskakov
@ 2025-07-09 13:40 ` bluez.test.bot
0 siblings, 0 replies; 10+ messages in thread
From: bluez.test.bot @ 2025-07-09 13:40 UTC (permalink / raw)
To: linux-bluetooth, i.iskakov
[-- Attachment #1: Type: text/plain, Size: 1864 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=980500
---Test result---
Test Summary:
CheckPatch PENDING 0.27 seconds
GitLint PENDING 0.27 seconds
BuildEll PASS 20.71 seconds
BluezMake PASS 2771.19 seconds
MakeCheck PASS 20.05 seconds
MakeDistcheck PASS 184.73 seconds
CheckValgrind PASS 235.29 seconds
CheckSmatch WARNING 307.39 seconds
bluezmakeextell PASS 129.11 seconds
IncrementalBuild PENDING 0.26 seconds
ScanBuild PASS 934.68 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structures
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH BlueZ v2 01/11] btio: fix range validation of security level
@ 2025-07-08 11:08 Ismagil Iskakov
2025-07-08 12:44 ` Fix bugs found by static analysis bluez.test.bot
0 siblings, 1 reply; 10+ messages in thread
From: Ismagil Iskakov @ 2025-07-08 11:08 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ismagil Iskakov
Arrays inside l2cap_set_lm/rfcomm_set_lm functions are of size 4,
but the bounds check allows the value 4 for 'level'.
---
btio/btio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/btio/btio.c b/btio/btio.c
index b8afe0580..14f2b700e 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -455,7 +455,7 @@ static gboolean set_sec_level(int sock, BtIOType type, int level, GError **err)
struct bt_security sec;
int ret;
- if (level < BT_SECURITY_LOW || level > BT_SECURITY_FIPS) {
+ if (level < BT_SECURITY_LOW || level > BT_SECURITY_HIGH) {
g_set_error(err, BT_IO_ERROR, EINVAL,
"Valid security level range is %d-%d",
BT_SECURITY_LOW, BT_SECURITY_HIGH);
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* RE: Fix bugs found by static analysis
2025-07-08 11:08 [PATCH BlueZ v2 01/11] btio: fix range validation of security level Ismagil Iskakov
@ 2025-07-08 12:44 ` bluez.test.bot
0 siblings, 0 replies; 10+ messages in thread
From: bluez.test.bot @ 2025-07-08 12:44 UTC (permalink / raw)
To: linux-bluetooth, i.iskakov
[-- Attachment #1: Type: text/plain, Size: 2866 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=980014
---Test result---
Test Summary:
CheckPatch PENDING 0.27 seconds
GitLint PENDING 0.23 seconds
BuildEll PASS 20.07 seconds
BluezMake PASS 2677.72 seconds
MakeCheck PASS 20.01 seconds
MakeDistcheck PASS 184.57 seconds
CheckValgrind PASS 233.46 seconds
CheckSmatch WARNING 303.91 seconds
bluezmakeextell PASS 128.51 seconds
IncrementalBuild PENDING 0.25 seconds
ScanBuild PASS 935.76 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structures
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH BlueZ 01/11] btio: fix range validation of security level
@ 2025-07-08 7:33 Ismagil Iskakov
2025-07-08 7:51 ` Fix bugs found by static analysis bluez.test.bot
0 siblings, 1 reply; 10+ messages in thread
From: Ismagil Iskakov @ 2025-07-08 7:33 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ismagil Iskakov
Arrays inside l2cap_set_lm/rfcomm_set_lm functions are of size 4,
but the bounds check allows the value 4 for 'level'.
---
btio/btio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/btio/btio.c b/btio/btio.c
index b8afe0580..14f2b700e 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -455,7 +455,7 @@ static gboolean set_sec_level(int sock, BtIOType type, int level, GError **err)
struct bt_security sec;
int ret;
- if (level < BT_SECURITY_LOW || level > BT_SECURITY_FIPS) {
+ if (level < BT_SECURITY_LOW || level > BT_SECURITY_HIGH) {
g_set_error(err, BT_IO_ERROR, EINVAL,
"Valid security level range is %d-%d",
BT_SECURITY_LOW, BT_SECURITY_HIGH);
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread* RE: Fix bugs found by static analysis
2025-07-08 7:33 [PATCH BlueZ 01/11] btio: fix range validation of security level Ismagil Iskakov
@ 2025-07-08 7:51 ` bluez.test.bot
0 siblings, 0 replies; 10+ messages in thread
From: bluez.test.bot @ 2025-07-08 7:51 UTC (permalink / raw)
To: linux-bluetooth, i.iskakov
[-- Attachment #1: Type: text/plain, Size: 7677 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=979927
---Test result---
Test Summary:
CheckPatch PENDING 0.21 seconds
GitLint PENDING 0.28 seconds
BuildEll PASS 20.46 seconds
BluezMake FAIL 19.04 seconds
MakeCheck FAIL 33.43 seconds
MakeDistcheck PASS 182.31 seconds
CheckValgrind FAIL 15.70 seconds
CheckSmatch FAIL 22.20 seconds
bluezmakeextell FAIL 13.10 seconds
IncrementalBuild PENDING 0.24 seconds
ScanBuild FAIL 22.64 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: BluezMake - FAIL
Desc: Build BlueZ
Output:
src/shared/bap.c: In function ‘bap_bcast_io_dir’:
src/shared/bap.c:2612:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
2612 | uint8_t dir;
| ^~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:7469: src/shared/libshared_mainloop_la-bap.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4030: all] Error 2
##############################
Test: MakeCheck - FAIL
Desc: Run Bluez Make Check
Output:
src/shared/bap.c: In function ‘bap_bcast_io_dir’:
src/shared/bap.c:2612:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
2612 | uint8_t dir;
| ^~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:7224: src/shared/libshared_glib_la-bap.lo] Error 1
make: *** [Makefile:10435: check] Error 2
##############################
Test: CheckValgrind - FAIL
Desc: Run Bluez Make Check with Valgrind
Output:
src/shared/bap.c: In function ‘bap_bcast_io_dir’:
src/shared/bap.c:2612:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
2612 | uint8_t dir;
| ^~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:7469: src/shared/libshared_mainloop_la-bap.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:10435: check] Error 2
##############################
Test: CheckSmatch - FAIL
Desc: Run smatch tool with source
Output:
src/shared/crypto.c:271:21: warning: Variable length array is used.
src/shared/crypto.c:272:23: warning: Variable length array is used.
src/shared/gatt-helpers.c:768:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:830:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1323:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1354:23: warning: Variable length array is used.
src/shared/gatt-server.c:278:25: warning: Variable length array is used.
src/shared/gatt-server.c:618:25: warning: Variable length array is used.
src/shared/gatt-server.c:716:25: warning: Variable length array is used.
src/shared/bap.c:2612:9: warning: mixing declarations and code
src/shared/bap.c:317:25: warning: array of flexible structures
src/shared/bap.c: note: in included file:
./src/shared/ascs.h:88:25: warning: array of flexible structures
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function'
/usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction'
/usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction'
/usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction'
src/shared/bap.c: In function ‘bap_bcast_io_dir’:
src/shared/bap.c:2612:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
2612 | uint8_t dir;
| ^~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:7469: src/shared/libshared_mainloop_la-bap.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4030: all] Error 2
##############################
Test: bluezmakeextell - FAIL
Desc: Build Bluez with External ELL
Output:
src/shared/bap.c: In function ‘bap_bcast_io_dir’:
src/shared/bap.c:2612:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
2612 | uint8_t dir;
| ^~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:7469: src/shared/libshared_mainloop_la-bap.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4030: all] Error 2
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
##############################
Test: ScanBuild - FAIL
Desc: Run Scan Build
Output:
src/shared/bap.c: In function ‘bap_bcast_io_dir’:
src/shared/bap.c:2612:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
2612 | uint8_t dir;
| ^~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:7469: src/shared/libshared_mainloop_la-bap.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
src/shared/gatt-client.c:451:21: warning: Use of memory after it is freed
gatt_db_unregister(op->client->db, op->db_id);
^~~~~~~~~~
src/shared/gatt-client.c:696:2: warning: Use of memory after it is freed
discovery_op_complete(op, false, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:996:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1102:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1296:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1361:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1636:6: warning: Use of memory after it is freed
if (read_db_hash(op)) {
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1641:2: warning: Use of memory after it is freed
discover_all(op);
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:2147:6: warning: Use of memory after it is freed
if (read_db_hash(op)) {
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:2155:8: warning: Use of memory after it is freed
discovery_op_ref(op),
^~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:3180:2: warning: Use of memory after it is freed
complete_write_long_op(req, success, 0, false);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:3202:2: warning: Use of memory after it is freed
request_unref(req);
^~~~~~~~~~~~~~~~~~
12 warnings generated.
make: *** [Makefile:4030: all] Error 2
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-07-09 15:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 13:36 [PATCH BlueZ v4 0/4] Fix bugs found by static analysis Ismagil Iskakov
2025-07-09 13:36 ` [PATCH BlueZ v4 1/4] btio: fix range validation of security level Ismagil Iskakov
2025-07-09 15:11 ` Fix bugs found by static analysis bluez.test.bot
2025-07-09 13:36 ` [PATCH BlueZ v4 2/4] profiles/audio: add nullity checks Ismagil Iskakov
2025-07-09 13:36 ` [PATCH BlueZ v4 3/4] src/shared: " Ismagil Iskakov
2025-07-09 13:36 ` [PATCH BlueZ v4 4/4] obexd/client: fix err condition causing memleak Ismagil Iskakov
2025-07-09 14:00 ` [PATCH BlueZ v4 0/4] Fix bugs found by static analysis patchwork-bot+bluetooth
-- strict thread matches above, loose matches on Subject: below --
2025-07-09 12:18 [PATCH BlueZ v3 1/4] btio: fix range validation of security level Ismagil Iskakov
2025-07-09 13:40 ` Fix bugs found by static analysis bluez.test.bot
2025-07-08 11:08 [PATCH BlueZ v2 01/11] btio: fix range validation of security level Ismagil Iskakov
2025-07-08 12:44 ` Fix bugs found by static analysis bluez.test.bot
2025-07-08 7:33 [PATCH BlueZ 01/11] btio: fix range validation of security level Ismagil Iskakov
2025-07-08 7:51 ` Fix bugs found by static analysis bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox