-
Notifications
You must be signed in to change notification settings - Fork 8k
[backport v2.1] lib: updatehub: Improve download on slow networks and apply security fix #27893
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.1] lib: updatehub: Improve download on slow networks and apply security fix #27893
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 <[email protected]>
Based on the current platform a warning can raise becase of missing string.h include file. Signed-off-by: Gerson Fernando Budke <[email protected]>
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.1 frdm-k64f is the reference platform. Signed-off-by: Gerson Fernando Budke <[email protected]>
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 <[email protected]> Signed-off-by: Gerson Fernando Budke <[email protected]>
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 <[email protected]>
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 <[email protected]>
Init metadata variable to a defined state. Signed-off-by: Gerson Fernando Budke <[email protected]>
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 <[email protected]>
Allow select max CoAP block size for exchange data using coap protocol. Signed-off-by: Gerson Fernando Budke <[email protected]>
Add missing freeaddrinfo to fix memory leak. Fixes zephyrproject-rtos#26994. Signed-off-by: Gerson Fernando Budke <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2020-08-30 21:34:55 FATAL Could not find a default pipeline configuration file. |
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. |
2.1 is out of scope for backports now, closing. |
This backport apply:
#25683, #26093, #27223, #27222, #27865
and fixes:
#25704, #26992, #26993, #26994, #27718
CC @otavio