2021-06-11 12:32:34

by Sebastian Urban

[permalink] [raw]
Subject: [PATCH BlueZ] gatt-client: Check length of notify multiple op

Check that specfied length of value in received data does not exceed
length of PDU. Otherwise data may be read from beyond the end of the
buffer.
---
src/shared/gatt-client.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 9511ea8ca..094922486 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -2173,6 +2173,9 @@ static void notify_cb(struct bt_att_chan *chan, uint8_t opcode,
length -= 2;
pdu += 2;

+ if (data.len > length)
+ data.len = length;
+
data.data = pdu;

queue_foreach(client->notify_list, notify_handler,
--
2.25.1


2021-06-11 12:56:18

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ] gatt-client: Check length of notify multiple op

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

---Test result---

Test Summary:
CheckPatch PASS 0.62 seconds
GitLint PASS 0.14 seconds
Prep - Setup ELL PASS 47.26 seconds
Build - Prep PASS 0.14 seconds
Build - Configure PASS 8.36 seconds
Build - Make PASS 207.71 seconds
Make Check PASS 9.15 seconds
Make Distcheck PASS 243.46 seconds
Build w/ext ELL - Configure PASS 8.38 seconds
Build w/ext ELL - Make PASS 195.76 seconds

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

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

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth

2021-06-16 11:25:11

by Sebastian Urban

[permalink] [raw]
Subject: RE: [BlueZ] gatt-client: Check length of notify multiple op

Hi Luiz,

thanks for applying my other two patches.

Has this one been missed or are there still changes required?

Sebastian

> -----Original Message-----
> From: [email protected] <[email protected]>
> Sent: Friday, June 11, 2021 2:53 PM
> To: [email protected]; Sebastian Urban <[email protected]>
> Subject: RE: [BlueZ] gatt-client: Check length of notify multiple op
>
> 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=498859
>
> ---Test result---
>
> Test Summary:
> CheckPatch PASS 0.62 seconds
> GitLint PASS 0.14 seconds
> Prep - Setup ELL PASS 47.26 seconds
> Build - Prep PASS 0.14 seconds
> Build - Configure PASS 8.36 seconds
> Build - Make PASS 207.71 seconds
> Make Check PASS 9.15 seconds
> Make Distcheck PASS 243.46 seconds
> Build w/ext ELL - Configure PASS 8.38 seconds
> Build w/ext ELL - Make PASS 195.76 seconds
>
> Details
> ##############################
> Test: CheckPatch - PASS
> Desc: Run checkpatch.pl script with rule in .checkpatch.conf
>
> ##############################
> Test: GitLint - PASS
> Desc: Run gitlint with rule in .gitlint
>
> ##############################
> Test: Prep - Setup ELL - PASS
> Desc: Clone, build, and install ELL
>
> ##############################
> Test: Build - Prep - PASS
> Desc: Prepare environment for build
>
> ##############################
> Test: Build - Configure - PASS
> Desc: Configure the BlueZ source tree
>
> ##############################
> Test: Build - Make - PASS
> Desc: Build the BlueZ source tree
>
> ##############################
> Test: Make Check - PASS
> Desc: Run 'make check'
>
> ##############################
> Test: Make Distcheck - PASS
> Desc: Run distcheck to check the distribution
>
> ##############################
> Test: Build w/ext ELL - Configure - PASS
> Desc: Configure BlueZ source with '--enable-external-ell' configuration
>
> ##############################
> Test: Build w/ext ELL - Make - PASS
> Desc: Build BlueZ source with '--enable-external-ell' configuration
>
>
>
> ---
> Regards,
> Linux Bluetooth

2021-06-16 17:03:07

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [BlueZ] gatt-client: Check length of notify multiple op

Hi Sebastian,

On Wed, Jun 16, 2021 at 4:25 AM Sebastian Urban <[email protected]> wrote:
>
> Hi Luiz,
>
> thanks for applying my other two patches.
>
> Has this one been missed or are there still changes required?
>
> Sebastian
>
> > -----Original Message-----
> > From: [email protected] <[email protected]>
> > Sent: Friday, June 11, 2021 2:53 PM
> > To: [email protected]; Sebastian Urban <[email protected]>
> > Subject: RE: [BlueZ] gatt-client: Check length of notify multiple op
> >
> > 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=498859
> >
> > ---Test result---
> >
> > Test Summary:
> > CheckPatch PASS 0.62 seconds
> > GitLint PASS 0.14 seconds
> > Prep - Setup ELL PASS 47.26 seconds
> > Build - Prep PASS 0.14 seconds
> > Build - Configure PASS 8.36 seconds
> > Build - Make PASS 207.71 seconds
> > Make Check PASS 9.15 seconds
> > Make Distcheck PASS 243.46 seconds
> > Build w/ext ELL - Configure PASS 8.38 seconds
> > Build w/ext ELL - Make PASS 195.76 seconds
> >
> > Details
> > ##############################
> > Test: CheckPatch - PASS
> > Desc: Run checkpatch.pl script with rule in .checkpatch.conf
> >
> > ##############################
> > Test: GitLint - PASS
> > Desc: Run gitlint with rule in .gitlint
> >
> > ##############################
> > Test: Prep - Setup ELL - PASS
> > Desc: Clone, build, and install ELL
> >
> > ##############################
> > Test: Build - Prep - PASS
> > Desc: Prepare environment for build
> >
> > ##############################
> > Test: Build - Configure - PASS
> > Desc: Configure the BlueZ source tree
> >
> > ##############################
> > Test: Build - Make - PASS
> > Desc: Build the BlueZ source tree
> >
> > ##############################
> > Test: Make Check - PASS
> > Desc: Run 'make check'
> >
> > ##############################
> > Test: Make Distcheck - PASS
> > Desc: Run distcheck to check the distribution
> >
> > ##############################
> > Test: Build w/ext ELL - Configure - PASS
> > Desc: Configure BlueZ source with '--enable-external-ell' configuration
> >
> > ##############################
> > Test: Build w/ext ELL - Make - PASS
> > Desc: Build BlueZ source with '--enable-external-ell' configuration
> >
> >
> >
> > ---
> > Regards,
> > Linux Bluetooth

Applied, thanks.

--
Luiz Augusto von Dentz