Skip to contentSkip to conversation

gatt: Fix potential buffer out-of-bound

PATCH In review Luiz Augusto von Dentz 2 participants 3 messages Jan 4, 2021 – Jan 5, 2021 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 gatt: Fix potential buffer out-of-bound

From: Luiz Augusto von Dentz <[email protected]>

When client features is read check if the offset is within the cli_feat bounds.

---
 src/gatt-database.c | 5 +++++
 1 file changed, 5 insertions(+)
src/gatt-database.c +5 -0
index 90cc4bade..f2d7b5821 100644
@@ -1075,6 +1075,11 @@ static void cli_feat_read_cb(struct gatt_db_attribute *attrib,
 		goto done;
 	}
 
+	if (offset >= sizeof(state->cli_feat)) {
+		ecode = BT_ATT_ERROR_INVALID_OFFSET;
+		goto done;
+	}
+
 	len = sizeof(state->cli_feat) - offset;
 	value = len ? &state->cli_feat[offset] : NULL;
 
Signature · 1 line
2.26.2
#1 lore raw

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

---Test result---

##############################
Test: CheckPatch - PASS

##############################
Test: CheckGitLint - PASS

##############################
Test: CheckBuild - PASS

##############################
Test: MakeCheck - PASS

---
Regards,
Linux Bluetooth

author maintainer
#2 lore raw

Hi,

Quoted 20 lines · On Mon, Jan 4, 2021 at 10:57 AM <[email protected]> wrote:

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

---Test result---

##############################
Test: CheckPatch - PASS

##############################
Test: CheckGitLint - PASS

##############################
Test: CheckBuild - PASS

Quoted 8 lines

##############################
Test: MakeCheck - PASS

---
Regards,
Linux Bluetooth

Pushed.

Signature · 1 line
Luiz Augusto von Dentz