-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[backport v2.2] lib: updatehub: Improve download on slow networks and apply security fix #27891
[backport v2.2] lib: updatehub: Improve download on slow networks and apply security fix #27891
Conversation
The conversion from DT_FLASH_AREA to FLASH_AREA macros don't add the storage flash_map.h include file. Fixes: zephyrproject-rtos#25332 Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Based on the current platform a warning can raise becase of missing string.h include file. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
b139317
to
bf9568e
Compare
Add missing sample.yaml file to enable CI build tests. Local tests can be executed executing sanitycheck: ./scripts/sanitycheck -l --testcase-root samples/net/updatehub On zephyr 2.2 frdm-k64f is the reference platform. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Fix variable-size string copy patch that introduced a runtime bug that causes a bus fault. Fixes zephyrproject-rtos#24853. Signed-off-by: Tahir Akram <mtahirbutt@hotmail.com> Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Current log only prints default log level. Add LOG_LEVEL at updatehub to switch between log variations based on CONFIG_UPDATEHUB_LOG_LEVEL. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
The hints variable is used without a defined state. This fill the struct with zeros to set variable at a well known state. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Init metadata variable to a defined state. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
The current implementation uses a fixed value for max retries. That value could be good for an wired network like Ethernet. However, wireless network can suffer with higher packet collision, low reception signal etc. This refacts the variable to be defined at Kconfig. This way max retries can be adjust conform the current media. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Allow select max CoAP block size for exchange data using coap protocol. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Add missing freeaddrinfo to fix memory leak. Fixes zephyrproject-rtos#26994. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
The struct pollfd context variable is not proper initialized and index is out-of-bounds. Adjusts index to be inside scope boundary. Fixes zephyrproject-rtos#26993. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
The flash_img_int return value is not checked for fail conditions. This can result on useless download attempts once image will not be properly recorded. Add return value check and on error execute default treatment. Fixes zephyrproject-rtos#26992. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
There are several references to objects[1] at updatehub_probe function. The structures are decoded from json, and have a maximum length of 2. However, if the returned json only has a single element in this array, this objects[1] value will be uninitialized. Because the structure contains pointers, these will be uninitialized, causing the code to reference uninitialized memory as pointers. Add zeroing memory before passing it to the JSON API and do check if objects_len field is two. Fixes zephyrproject-rtos#27718. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
When running shell commands updatehub alloc data from shell stack. Increase shell room stack to avoid shell issues. Memory tuning should be performed accord with available resources. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
bf9568e
to
fc0c456
Compare
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
It is on todo, removing stale. |
v2.2 is out of scope for backports right now, closing. Use a more recent version. |
This backport apply:
#25683, #26093, #27223, #27222, #27865
and fixes:
#25704, #26992, #26993, #26994, #27718
CC @otavio