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

Fix ACL constraint error (return constraint error instead of failure when the ACL entry is invalid) #20890

Merged

Conversation

woody-apple
Copy link
Contributor

Problem

FAILURE reported instead of CONSTRAINT_ERROR

Fixes #20672
Fixes #20794
Fixes #20796
Fixes #20797 (NOTE: uses 0xFFFF_FFFD_0000_0000 and NOT the original test value as that seemed odd)
Fixes #20798

Change overview

Fix return code
Add unit tests for automation

I could NOT add tests for the 64bit invalid subjects due to zap limitation (was later explained that I need to use quotes). In the mean time, the tests not covered were broken out in separate bugs that will be fixed separately.

Testing

Automated testing (yay!)

…when the ACL entry is invalid) (#20736)

* Define a test for access control constraints

* Typgo fixes

* Restyle

* Fix some text and formatting

* Zap regen

* Make ACL cluster return constraint error if the ACL entry is not valid

* Add one more test: Step 31

* Zap regen for the new test

* Added the rest of the tests from #20672

* Restyle

* Removed some steps: too large numbers for subjects, cannot be represented

* Zap regen

* Restyle

* Fix build, add more ACL changes, zap regen after adjusting test case to match bug report

* Fix more things to return CONSTRAINT_ERROR

* Convert more invalid argument to constraint errors. This is not ideal and seems like a whack-a-mole bug fixing

* Restyle

* Fix comments in yaml

* Restyle

* Restyle messed things up. Corrected it

* One more comment fix

* Restyle

* Split out IM status code header and cpp into a separate library for layering purposes. Layering still not ideal though.

* Restyle

* Also update TestAccessControlCluster

* Zap regen

* Updated test ACL error codes a bit and zap regen

* Update logic to centrailize error code processing location

* Added unit test for step 35 as well (pass)

* Added even more tests and updated formatting of ACL a bit for readability

* Restyle

* One more test for invalid privilege

* Restyle
@github-actions
Copy link

github-actions bot commented Jul 18, 2022

PR #20890: Size comparison from dfbe55d to eba01d3

Increases (32 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section dfbe55d eba01d3 change % change
bl602 lighting-app bl602 (read/write) 1383418 1383570 152 0.0
.text 1053500 1053616 116 0.0
bl602+rpc (read/write) 1428850 1429010 160 0.0
.text 1085180 1085300 120 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 668199 668303 104 0.0
.rodata 88271 88319 48 0.1
.text 579612 579668 56 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 633831 633951 120 0.0
.rodata 77511 77551 40 0.1
.text 555996 556076 80 0.0
lock-ftd LP_CC2652R7 (read only) 671403 671507 104 0.0
.rodata 76411 76451 40 0.1
.text 594512 594576 64 0.0
lock-mtd LP_CC2652R7 (read only) 653655 653791 136 0.0
.rodata 101151 101199 48 0.0
.text 552024 552112 88 0.0
pump-app LP_CC2652R7 (read only) 680379 680499 120 0.0
.rodata 88771 88811 40 0.0
.text 591124 591204 80 0.0
pump-controller-app LP_CC2652R7 (read only) 666179 666291 112 0.0
.rodata 84627 84675 48 0.1
.text 581072 581136 64 0.0
shell LP_CC2652R7 (read only) 660682 660802 120 0.0
.rodata 85058 85098 40 0.0
.text 575308 575388 80 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 581774 581830 56 0.0
.app_xip_area 460480 460536 56 0.0
lock cyw930739m2evb_01 (read/write) 587690 587754 64 0.0
.app_xip_area 461668 461732 64 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 585050 585178 128 0.0
.app_xip_area 464604 464732 128 0.0
efr32 lighting-app BRD4161A (read/write) 1084640 1084760 120 0.0
.text 949528 949648 120 0.0
BRD4161A+rpc (read/write) 1138972 1139100 128 0.0
.text 986964 987092 128 0.0
BRD4161A+rs911x (read/write) 950008 950128 120 0.0
.text 807172 807292 120 0.0
lock-app BRD4161A+wf200 (read/write) 1127788 1127908 120 0.0
.text 981576 981696 120 0.0
window-app BRD4161A (read/write) 1078132 1078268 136 0.0
.text 941520 941656 136 0.0
esp32 all-clusters-app c3devkit (read only) 1021570 1021656 86 0.0
(read/write) 1485978 1486026 48 0.0
.flash.rodata 215864 215912 48 0.0
.flash.text 1021570 1021656 86 0.0
m5stack (read only) 1075299 1075363 64 0.0
(read/write) 488024 488064 40 0.0
.flash.rodata 246284 246324 40 0.0
.flash.text 1069915 1069979 64 0.0
k32w light k32w061+release (read/write) 660524 660604 80 0.0
.text 583192 583272 80 0.0
lock k32w061+release (read/write) 687476 687588 112 0.0
.text 609668 609780 112 0.0
linux chip-tool-ipv6only arm64 (read only) 10020620 10034572 13952 0.1
(read/write) 693617 694577 960 0.1
.data.rel.ro 629816 630768 952 0.2
.got 13616 13624 8 0.1
.rodata 478236 479052 816 0.2
.text 7964676 7975556 10880 0.1
thermostat-no-ble arm64 (read only) 2599428 2600052 624 0.0
.rodata 165700 165748 48 0.0
.text 2193984 2194560 576 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2448952 2449064 112 0.0
.text 1411596 1411708 112 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1176443 1176547 104 0.0
rodata 142164 142204 40 0.0
text 812472 812544 72 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1156491 1156611 120 0.0
rodata 133708 133748 40 0.0
text 801776 801852 76 0.0
p6 all-clusters-app default (read/write) 2568432 2568568 136 0.0
.text 1526696 1526832 136 0.0
all-clusters-minimal-app default (read/write) 2513312 2513432 120 0.0
.text 1471576 1471696 120 0.0
light-app default (read/write) 2443296 2443424 128 0.0
.text 1401560 1401688 128 0.0
lock-app default (read/write) 2470384 2470512 128 0.0
.text 1428648 1428776 128 0.0
telink light-switch-app tlsr9518adk80d (read/write) 798456 798604 148 0.0
text 566612 566716 104 0.0
lighting-app tlsr9518adk80d (read/write) 818496 818636 140 0.0
text 583146 583248 102 0.0
Decreases (6 builds for cc13x2_26x2)
platform target config section dfbe55d eba01d3 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read/write) 183040 182936 -104 -0.1
lock-ftd LP_CC2652R7 (read/write) 170012 169908 -104 -0.1
lock-mtd LP_CC2652R7 (read/write) 183448 183312 -136 -0.1
pump-app LP_CC2652R7 (read/write) 161884 161764 -120 -0.1
pump-controller-app LP_CC2652R7 (read/write) 176204 176092 -112 -0.1
shell LP_CC2652R7 (read/write) 186060 185940 -120 -0.1
Full report (32 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section dfbe55d eba01d3 change % change
bl602 lighting-app bl602 (read/write) 1383418 1383570 152 0.0
.bss 116978 116978 0 0.0
.data 4480 4480 0 0.0
.text 1053500 1053616 116 0.0
bl602+rpc (read/write) 1428850 1429010 160 0.0
.bss 124418 124418 0 0.0
.data 4600 4600 0 0.0
.text 1085180 1085300 120 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 668199 668303 104 0.0
(read/write) 183040 182936 -104 -0.1
.bss 74132 74132 0 0.0
.data 3356 3356 0 0.0
.rodata 88271 88319 48 0.1
.text 579612 579668 56 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 633831 633951 120 0.0
(read/write) 157700 157700 0 0.0
.bss 73428 73428 0 0.0
.data 3356 3356 0 0.0
.rodata 77511 77551 40 0.1
.text 555996 556076 80 0.0
lock-ftd LP_CC2652R7 (read only) 671403 671507 104 0.0
(read/write) 170012 169908 -104 -0.1
.bss 71196 71196 0 0.0
.data 3280 3280 0 0.0
.rodata 76411 76451 40 0.1
.text 594512 594576 64 0.0
lock-mtd LP_CC2652R7 (read only) 653655 653791 136 0.0
(read/write) 183448 183312 -136 -0.1
.bss 66884 66884 0 0.0
.data 3280 3280 0 0.0
.rodata 101151 101199 48 0.0
.text 552024 552112 88 0.0
pump-app LP_CC2652R7 (read only) 680379 680499 120 0.0
(read/write) 161884 161764 -120 -0.1
.bss 71276 71276 0 0.0
.data 3280 3280 0 0.0
.rodata 88771 88811 40 0.0
.text 591124 591204 80 0.0
pump-controller-app LP_CC2652R7 (read only) 666179 666291 112 0.0
(read/write) 176204 176092 -112 -0.1
.bss 71396 71396 0 0.0
.data 3276 3276 0 0.0
.rodata 84627 84675 48 0.1
.text 581072 581136 64 0.0
shell LP_CC2652R7 (read only) 660682 660802 120 0.0
(read/write) 186060 185940 -120 -0.1
.bss 76436 76436 0 0.0
.data 3360 3360 0 0.0
.rodata 85058 85098 40 0.0
.text 575308 575388 80 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 581774 581830 56 0.0
.app_xip_area 460480 460536 56 0.0
.bss 64232 64232 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) 587690 587754 64 0.0
.app_xip_area 461668 461732 64 0.0
.bss 68960 68960 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) 585050 585178 128 0.0
.app_xip_area 464604 464732 128 0.0
.bss 63440 63440 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) 1084640 1084760 120 0.0
.bss 133044 133044 0 0.0
.data 2048 2048 0 0.0
.text 949528 949648 120 0.0
BRD4161A+rpc (read/write) 1138972 1139100 128 0.0
.bss 149724 149724 0 0.0
.data 2260 2260 0 0.0
.text 986964 987092 128 0.0
BRD4161A+rs911x (read/write) 950008 950128 120 0.0
.bss 140768 140768 0 0.0
.data 2048 2048 0 0.0
.text 807172 807292 120 0.0
lock-app BRD4161A+wf200 (read/write) 1127788 1127908 120 0.0
.bss 144136 144136 0 0.0
.data 2056 2056 0 0.0
.text 981576 981696 120 0.0
window-app BRD4161A (read/write) 1078132 1078268 136 0.0
.bss 134516 134516 0 0.0
.data 2076 2076 0 0.0
.text 941520 941656 136 0.0
esp32 all-clusters-app c3devkit (read only) 1021570 1021656 86 0.0
(read/write) 1485978 1486026 48 0.0
.dram0.bss 70080 70080 0 0.0
.dram0.data 14600 14600 0 0.0
.flash.rodata 215864 215912 48 0.0
.flash.text 1021570 1021656 86 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1075299 1075363 64 0.0
(read/write) 488024 488064 40 0.0
.dram0.bss 75600 75600 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 246284 246324 40 0.0
.flash.text 1069915 1069979 64 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 660524 660604 80 0.0
.bss 69540 69540 0 0.0
.data 1992 1992 0 0.0
.text 583192 583272 80 0.0
lock k32w061+release (read/write) 687476 687588 112 0.0
.bss 70004 70004 0 0.0
.data 2004 2004 0 0.0
.text 609668 609780 112 0.0
linux chip-tool-ipv6only arm64 (read only) 10020620 10034572 13952 0.1
(read/write) 693617 694577 960 0.1
.bss 42961 42961 0 0.0
.data 3304 3304 0 0.0
.data.rel.ro 629816 630768 952 0.2
.dynamic 528 528 0 0.0
.got 13616 13624 8 0.1
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 478236 479052 816 0.2
.text 7964676 7975556 10880 0.1
thermostat-no-ble arm64 (read only) 2599428 2600052 624 0.0
(read/write) 158257 158257 0 0.0
.bss 65249 65249 0 0.0
.data 1704 1704 0 0.0
.data.rel.ro 83216 83216 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 165700 165748 48 0.0
.text 2193984 2194560 576 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2448952 2449064 112 0.0
.bss 213940 213940 0 0.0
.data 5872 5872 0 0.0
.text 1411596 1411708 112 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1176443 1176547 104 0.0
bss 142900 142900 0 0.0
rodata 142164 142204 40 0.0
text 812472 812544 72 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1156491 1156611 120 0.0
bss 142136 142136 0 0.0
rodata 133708 133748 40 0.0
text 801776 801852 76 0.0
p6 all-clusters-app default (read/write) 2568432 2568568 136 0.0
.bss 149120 149120 0 0.0
.data 2776 2776 0 0.0
.text 1526696 1526832 136 0.0
all-clusters-minimal-app default (read/write) 2513312 2513432 120 0.0
.bss 148400 148400 0 0.0
.data 2776 2776 0 0.0
.text 1471576 1471696 120 0.0
light-app default (read/write) 2443296 2443424 128 0.0
.bss 140456 140456 0 0.0
.data 2592 2592 0 0.0
.text 1401560 1401688 128 0.0
lock-app default (read/write) 2470384 2470512 128 0.0
.bss 140304 140304 0 0.0
.data 2600 2600 0 0.0
.text 1428648 1428776 128 0.0
telink light-switch-app tlsr9518adk80d (read/write) 798456 798604 148 0.0
bss 70576 70576 0 0.0
noinit 40416 40416 0 0.0
text 566612 566716 104 0.0
lighting-app tlsr9518adk80d (read/write) 818496 818636 140 0.0
bss 71420 71420 0 0.0
noinit 40416 40416 0 0.0
text 583146 583248 102 0.0

@woody-apple woody-apple merged commit 3d2e23a into sve Jul 18, 2022
@woody-apple woody-apple deleted the cherry-pick-a773e05a5137bc4e8b2a4a8cac1d4e07d5efa511 branch July 18, 2022 23:50
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.

2 participants