Skip to content

Conversation

@trond-snekvik
Copy link
Contributor

@trond-snekvik trond-snekvik commented Feb 3, 2021

As network_decode needs a target buffer for decoding, the max PDU length
must be checked to prevent overflow on the target buffer. When receiving
a proxy configuration message with excessive length, there's no previous
check for this.

Also pulls the NET PDU length defines out into net.h, so they can be
used when defining the target buffers.

Fixes #31911

Signed-off-by: Trond Einar Snekvik Trond.Einar.Snekvik@nordicsemi.no

@trond-snekvik trond-snekvik added bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug labels Feb 3, 2021
@trond-snekvik trond-snekvik added this to the v2.5.0 milestone Feb 3, 2021
Copy link
Member

@jhedberg jhedberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. Btw, the Priority: label doesn't really do anything for pull requests (in that it would be considered by the formal release process), so you might want to consider opening an issue.

@trond-snekvik
Copy link
Contributor Author

Alright, I'll open an issue then. I think this is a serious enough issue that we should ensure it goes in.

As network_decode needs a target buffer for decoding, the max PDU length
must be checked to prevent overflow on the target buffer. When receiving
a proxy configuration message with excessive length, there's no previous
check for this.

Also pulls the NET PDU length defines out into net.h, so they can be
used when defining the target buffers.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nashif nashif merged commit 2bd5b63 into zephyrproject-rtos:master Feb 3, 2021
@trond-snekvik trond-snekvik deleted the net_pdu_maxlen branch February 3, 2021 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Mesh area: Bluetooth bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bluetooth: Mesh: Network buffer overflow on too long proxy messages

4 participants