2017-10-11 19:06:24

by Steve Brown

[permalink] [raw]
Subject: [PATCH] Bluetooth: mesh: Correct segmentation logic

The decision whether to segment or not didn't consider the size of the MIC

diff --git a/mesh/net.c b/mesh/net.c
index 2d75c4f7d..96e82fe1c 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -2098,7 +2098,7 @@ bool net_access_layer_send(uint8_t ttl, uint16_t src, uint32_t dst,
if (!result)
return false;

- segN = SEG_MAX(len);
+ segN = SEG_MAX(len + sizeof(uint32_t));

/* Only one ACK required SAR message per destination at a time */
if (segN && IS_UNICAST(dst)) {


2017-10-11 19:21:33

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: mesh: Correct segmentation logic

Hi Steve,

On Wed, Oct 11, 2017, Steve Brown wrote:
> The decision whether to segment or not didn't consider the size of the MIC
>
> diff --git a/mesh/net.c b/mesh/net.c
> index 2d75c4f7d..96e82fe1c 100644
> --- a/mesh/net.c
> +++ b/mesh/net.c
> @@ -2098,7 +2098,7 @@ bool net_access_layer_send(uint8_t ttl, uint16_t src, uint32_t dst,
> if (!result)
> return false;
>
> - segN = SEG_MAX(len);
> + segN = SEG_MAX(len + sizeof(uint32_t));
>
> /* Only one ACK required SAR message per destination at a time */
> if (segN && IS_UNICAST(dst)) {

Applied, thanks.

Johan

2017-10-11 19:10:06

by Gix, Brian

[permalink] [raw]
Subject: RE: [PATCH] Bluetooth: mesh: Correct segmentation logic

Hi Luiz, Marcel, Johan:

This is a legitimate and important fix. Please apply ASAP.

> -----Original Message-----
> From: [email protected] [mailto:linux-bluetooth-
> [email protected]] On Behalf Of Steve Brown
> Sent: Wednesday, October 11, 2017 12:06 PM
> To: [email protected]
> Subject: [PATCH] Bluetooth: mesh: Correct segmentation logic
>
> The decision whether to segment or not didn't consider the size of the MIC
>
> diff --git a/mesh/net.c b/mesh/net.c
> index 2d75c4f7d..96e82fe1c 100644
> --- a/mesh/net.c
> +++ b/mesh/net.c
> @@ -2098,7 +2098,7 @@ bool net_access_layer_send(uint8_t ttl, uint16_t
> src, uint32_t dst,
> if (!result)
> return false;
>
> - segN = SEG_MAX(len);
> + segN = SEG_MAX(len + sizeof(uint32_t));
>
> /* Only one ACK required SAR message per destination at a time */
> if (segN && IS_UNICAST(dst)) {
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected] More majordomo
> info at http://vger.kernel.org/majordomo-info.html