zephyr/subsys/bluetooth/mesh
Trond Einar Snekvik 69fcaaa592 Bluetooth: Mesh: Use separate net_bufs for bt_mesh_app_decrypt in friend
unseg_app_sdu_decrypt decrypts messages in place using a single net_buf.
While this is safe in terms of data access, the buffer state is
manipulated with the assumption that they're two different buffers, and
the output buffer's length field is increased at the end. When
assertions are enabled and the pdu length is 11 or 12 bytes, this
triggers the net_buf length assert, as the decrypt function attempts to
add the pdu length to the out buffer, with the assumption that it was
reset before decryption was started.

Create a separate output buffer with len = 0 to avoid triggering the
assert. Improve readability of the unseg_app_sdu functions to highlight
the need for the additional buffer.

Fixes #37519.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-08-20 12:49:28 +02:00
..
access.c Bluetooth: Mesh: Clarify name length in bt_mesh_model_data_store 2021-08-19 10:19:02 -04:00
access.h Bluetooth: Mesh: Refactor Mesh Model Extensions 2021-08-03 10:20:52 -04:00
adv_ext.c Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
adv_legacy.c bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
adv.c bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
adv.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
app_keys.c Bluetooth: Mesh: Redefine callback registration 2021-08-20 06:28:12 -04:00
app_keys.h Bluetooth: Mesh: Break up mesh settings 2021-01-14 16:38:50 +02:00
beacon.c Bluetooth: Mesh: Redefine callback registration 2021-08-20 06:28:12 -04:00
beacon.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
cdb.c Bluetooth: Mesh: Add CDB handle key refresh phase 2021-03-04 14:10:56 +02:00
cdb.h Bluetooth: Mesh: Break up mesh settings 2021-01-14 16:38:50 +02:00
cfg_cli.c Bluetooth: Mesh: Add API to discard subscription in vendor model 2021-08-19 10:19:02 -04:00
cfg_srv.c Bluetooth: Mesh: Refactor Mesh Model Extensions 2021-08-03 10:20:52 -04:00
cfg.c Bluetooth: Mesh: Restore default device configuration on reset 2021-07-02 16:58:21 +03:00
cfg.h Bluetooth: Mesh: Restore default device configuration on reset 2021-07-02 16:58:21 +03:00
CMakeLists.txt Bluetooth: Mesh: Rename proxy.c to proxy_msg.c 2021-07-09 17:56:16 +03:00
crypto.c Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
crypto.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
foundation.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
friend.c Bluetooth: Mesh: Use separate net_bufs for bt_mesh_app_decrypt in friend 2021-08-20 12:49:28 +02:00
friend.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
gatt_services.c Bluetooth: Mesh: Redefine callback registration 2021-08-20 06:28:12 -04:00
health_cli.c Bluetooth: Mesh: Fix Health Client Model 2021-07-22 22:41:32 +03:00
health_srv.c Bluetooth: Mesh: Add msg length check for Cfg and Health models 2021-07-15 11:34:52 +02:00
heartbeat.c toolchain: migrate iterable sections calls to the external API 2021-08-12 17:47:04 -04:00
heartbeat.h Bluetooth: Mesh: Break up mesh settings 2021-01-14 16:38:50 +02:00
Kconfig Bluetooth: Mesh: Add more explain for ADV_STACK_SIZE 2021-07-28 15:44:34 +02:00
lpn.c Bluetooth: Mesh: Redefine callback registration 2021-08-20 06:28:12 -04:00
lpn.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
main.c bluetooth: mesh: Fix IVU duration counter update 2021-08-19 10:19:43 -04:00
mesh.h toolchain: migrate iterable sections calls to the external API 2021-08-12 17:47:04 -04:00
msg.c Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
net.c bluetooth: mesh: Fix IVU duration counter update 2021-08-19 10:19:43 -04:00
net.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
pb_adv.c bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
pb_gatt.c bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
prov_bearer.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
prov_device.c bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
prov.c bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
prov.h bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
provisioner.c bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
provisioner.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
proxy_msg.c bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
proxy_msg.h Bluetooth: Mesh: Split proxy.h to proxy.h and proxy_msg.h 2021-07-09 17:56:16 +03:00
proxy.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
rpl.c Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
rpl.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
settings.c Bluetooth: Mesh: Add API to manually store pending RPL entries 2021-06-11 15:47:09 +02:00
settings.h Bluetooth: Mesh: Add API to manually store pending RPL entries 2021-06-11 15:47:09 +02:00
shell.c Bluetooth: Mesh: Mark as internal function 2021-08-03 10:21:16 -04:00
subnet.c toolchain: migrate iterable sections calls to the external API 2021-08-12 17:47:04 -04:00
subnet.h Bluetooth: Mesh: Redefine callback registration 2021-08-20 06:28:12 -04:00
test.c Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
test.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
TODO Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
transport.c Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00
transport.h Bluetooth: Mesh: Align capitalization for BT mesh 2021-07-13 11:23:54 -04:00