Skip to content
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

[zephyr] Pass storage audit #20298

Merged
merged 2 commits into from
Jul 5, 2022

Conversation

Damian-Nordic
Copy link
Contributor

Problem

KeyValueStore on Zephyr platforms does not pass the storage audit.

Change overview

  1. Provide workaround for storing empty values since it is not supported by the underlyng Zephyr settings subsystem.
  2. Escape "=" character as that's the end of a key in the Zephyr settings subsystem.
  3. Return the correct error code when removing non-existent key.
  4. Extend KVS unit tests.
    Fixes Ensure nRF Connect platform storage backend succeeds Storage audit #20201

Testing

Passed storage audit.
Did smoke tests.
Extended unit tests and ran on nRF Connect native_posix platform.

Add new test cases for handling empty keys, all printable
ASCII characters in keys and removing non-existent entry.

Make the code more consistent with the rest of the codebase.

Signed-off-by: Damian Krolik <[email protected]>
1. Provide workaround for storing empty values since it is
   not supported by the underlyng Zephyr settings subsystem.
2. Escape "=" character as that's the end of a key in the
   Zephyr settings subsystem.
3. Return the correct error code when removing non-existent
   key.
@Damian-Nordic Damian-Nordic changed the title Zephyr kvs fixes [zephyr] Pass storage audit Jul 5, 2022
@github-actions
Copy link

github-actions bot commented Jul 5, 2022

PR #20298: Size comparison from 13ac032 to a68004c

Increases (13 builds for k32w, nrfconnect, telink)
platform target config section 13ac032 a68004c change % change
k32w light k32w061+release (read/write) 658176 658192 16 0.0
.text 580868 580884 16 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1173323 1173375 52 0.0
rodata 141356 141360 4 0.0
text 810164 810216 52 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1154159 1154227 68 0.0
rodata 133288 133292 4 0.0
text 799856 799912 56 0.0
lighting-app nrf52840dk_nrf52840 (read/write) 1165467 1165535 68 0.0
rodata 123732 123736 4 0.0
text 818432 818488 56 0.0
nrf52840dk_nrf52840+rpc (read/write) 1135755 1135823 68 0.0
rodata 115204 115208 4 0.0
text 796424 796484 60 0.0
nrf52840dongle_nrf52840 (read/write) 1072331 1072379 48 0.0
text 746744 746796 52 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 1069182 1069250 68 0.0
rodata 116148 116152 4 0.0
text 731140 731196 56 0.0
lock-app nrf52840dk_nrf52840 (read/write) 1125563 1125615 52 0.0
rodata 141172 141176 4 0.0
text 770156 770208 52 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 1029418 1029466 48 0.0
text 682920 682976 56 0.0
pump-app nrf52840dk_nrf52840 (read/write) 1078435 1078499 64 0.0
text 748136 748192 56 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 1066463 1066515 52 0.0
rodata 113896 113900 4 0.0
text 739512 739564 52 0.0
telink light-switch-app tlsr9518adk80d (read/write) 796560 796636 76 0.0
text 565058 565130 72 0.0
lighting-app tlsr9518adk80d (read/write) 816388 816464 76 0.0
text 581380 581452 72 0.0
Full report (38 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 13ac032 a68004c change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 665427 665427 0 0.0
(read/write) 185796 185796 0 0.0
.bss 74116 74116 0 0.0
.data 3356 3356 0 0.0
.rodata 88099 88099 0 0.0
.text 577012 577012 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 631427 631427 0 0.0
(read/write) 157684 157684 0 0.0
.bss 73412 73412 0 0.0
.data 3356 3356 0 0.0
.rodata 77339 77339 0 0.0
.text 553764 553764 0 0.0
lock-ftd LP_CC2652R7 (read only) 668095 668095 0 0.0
(read/write) 173272 173272 0 0.0
.bss 71148 71148 0 0.0
.data 3280 3280 0 0.0
.rodata 76191 76191 0 0.0
.text 591424 591424 0 0.0
lock-mtd LP_CC2652R7 (read only) 617511 617511 0 0.0
(read/write) 144264 144264 0 0.0
.bss 66868 66868 0 0.0
.data 3280 3280 0 0.0
.rodata 76071 76071 0 0.0
.text 540952 540952 0 0.0
pump-app LP_CC2652R7 (read only) 677447 677447 0 0.0
(read/write) 164768 164768 0 0.0
.bss 71228 71228 0 0.0
.data 3280 3280 0 0.0
.rodata 88439 88439 0 0.0
.text 588524 588524 0 0.0
pump-controller-app LP_CC2652R7 (read only) 663279 663279 0 0.0
(read/write) 179056 179056 0 0.0
.bss 71348 71348 0 0.0
.data 3276 3276 0 0.0
.rodata 84279 84279 0 0.0
.text 578520 578520 0 0.0
shell LP_CC2652R7 (read only) 657878 657878 0 0.0
(read/write) 188848 188848 0 0.0
.bss 76420 76420 0 0.0
.data 3360 3360 0 0.0
.rodata 84846 84846 0 0.0
.text 572716 572716 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 578894 578894 0 0.0
.app_xip_area 457664 457664 0 0.0
.bss 64184 64184 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 580550 580550 0 0.0
.app_xip_area 459120 459120 0 0.0
.bss 64376 64376 0 0.0
.data 720 720 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 581958 581958 0 0.0
.app_xip_area 461576 461576 0 0.0
.bss 63392 63392 0 0.0
.data 660 660 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1080364 1080364 0 0.0
.bss 132996 132996 0 0.0
.data 2048 2048 0 0.0
.text 945300 945300 0 0.0
BRD4161A+rpc (read/write) 1134724 1134724 0 0.0
.bss 149676 149676 0 0.0
.data 2260 2260 0 0.0
.text 982768 982768 0 0.0
BRD4161A+rs911x (read/write) 946468 946468 0 0.0
.bss 140768 140768 0 0.0
.data 2048 2048 0 0.0
.text 803632 803632 0 0.0
lock-app BRD4161A+wf200 (read/write) 1127048 1127048 0 0.0
.bss 144184 144184 0 0.0
.data 2060 2060 0 0.0
.text 980780 980780 0 0.0
window-app BRD4161A (read/write) 1074164 1074164 0 0.0
.bss 134468 134468 0 0.0
.data 2076 2076 0 0.0
.text 937596 937596 0 0.0
esp32 all-clusters-app c3devkit (read only) 1018798 1018798 0 0.0
(read/write) 1484906 1484906 0 0.0
.dram0.bss 70080 70080 0 0.0
.dram0.data 14600 14600 0 0.0
.flash.rodata 214792 214792 0 0.0
.flash.text 1018798 1018798 0 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1072843 1072843 0 0.0
(read/write) 486984 486984 0 0.0
.dram0.bss 75600 75600 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 245244 245244 0 0.0
.flash.text 1067459 1067459 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 658176 658192 16 0.0
.bss 69516 69516 0 0.0
.data 1992 1992 0 0.0
.text 580868 580884 16 0.0
lock k32w061+release (read/write) 684772 684772 0 0.0
.bss 69980 69980 0 0.0
.data 2004 2004 0 0.0
.text 606988 606988 0 0.0
linux chip-tool-no-interactive-ipv6only arm64 (read only) 9922676 9922676 0 0.0
(read/write) 676609 676609 0 0.0
.bss 42609 42609 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 615592 615592 0 0.0
.dynamic 528 528 0 0.0
.got 13448 13448 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 470260 470260 0 0.0
.text 7910516 7910516 0 0.0
thermostat-no-ble arm64 (read only) 2592612 2592612 0 0.0
(read/write) 158289 158289 0 0.0
.bss 65249 65249 0 0.0
.data 1704 1704 0 0.0
.data.rel.ro 83240 83240 0 0.0
.dynamic 528 528 0 0.0
.got 5072 5072 0 0.0
.init 24 24 0 0.0
.init_array 400 400 0 0.0
.rodata 165348 165348 0 0.0
.text 2187488 2187488 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2447376 2447376 0 0.0
.bss 213940 213940 0 0.0
.data 5872 5872 0 0.0
.text 1410020 1410020 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1173323 1173375 52 0.0
bss 142900 142900 0 0.0
rodata 141356 141360 4 0.0
text 810164 810216 52 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1154159 1154227 68 0.0
bss 142136 142136 0 0.0
rodata 133288 133292 4 0.0
text 799856 799912 56 0.0
lighting-app nrf52840dk_nrf52840 (read/write) 1165467 1165535 68 0.0
bss 144463 144463 0 0.0
rodata 123732 123736 4 0.0
text 818432 818488 56 0.0
nrf52840dk_nrf52840+rpc (read/write) 1135755 1135823 68 0.0
bss 144892 144892 0 0.0
rodata 115204 115208 4 0.0
text 796424 796484 60 0.0
nrf52840dongle_nrf52840 (read/write) 1072331 1072379 48 0.0
bss 151694 151694 0 0.0
rodata 92772 92772 0 0.0
text 746744 746796 52 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 1069182 1069250 68 0.0
bss 140834 140834 0 0.0
rodata 116148 116152 4 0.0
text 731140 731196 56 0.0
lock-app nrf52840dk_nrf52840 (read/write) 1125563 1125615 52 0.0
bss 135431 135431 0 0.0
rodata 141172 141176 4 0.0
text 770156 770208 52 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 1029418 1029466 48 0.0
bss 131834 131834 0 0.0
rodata 133648 133648 0 0.0
text 682920 682976 56 0.0
pump-app nrf52840dk_nrf52840 (read/write) 1078435 1078499 64 0.0
bss 134358 134358 0 0.0
rodata 117116 117116 0 0.0
text 748136 748192 56 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 1066463 1066515 52 0.0
bss 134153 134153 0 0.0
rodata 113896 113900 4 0.0
text 739512 739564 52 0.0
p6 all-clusters-app default (read/write) 2563024 2563024 0 0.0
.bss 149120 149120 0 0.0
.data 2776 2776 0 0.0
.text 1521288 1521288 0 0.0
all-clusters-minimal-app default (read/write) 2508888 2508888 0 0.0
.bss 148400 148400 0 0.0
.data 2776 2776 0 0.0
.text 1467152 1467152 0 0.0
light-app default (read/write) 2439256 2439256 0 0.0
.bss 140456 140456 0 0.0
.data 2592 2592 0 0.0
.text 1397520 1397520 0 0.0
lock-app default (read/write) 2465672 2465672 0 0.0
.bss 140304 140304 0 0.0
.data 2600 2600 0 0.0
.text 1423936 1423936 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 796560 796636 76 0.0
bss 70576 70576 0 0.0
noinit 40416 40416 0 0.0
text 565058 565130 72 0.0
lighting-app tlsr9518adk80d (read/write) 816388 816464 76 0.0
bss 71420 71420 0 0.0
noinit 40416 40416 0 0.0
text 581380 581452 72 0.0

@woody-apple woody-apple merged commit 0418719 into project-chip:master Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure nRF Connect platform storage backend succeeds Storage audit
3 participants