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

[OpenThread] Harden DNS record parsing #31227

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

Damian-Nordic
Copy link
Contributor

OpenThread applications would crash upon receiving an empty DNS TXT record. The reason was that the code for copying OT DNS service info object into Matter DnssdService object would not initialize the TXT entry count in the latter object in such a case.

In the reported case, the Matter stack was presented an empty TXT record because OpenThread's DNS client received a TXT record with TTL 0 and it discarded its contents. Nevertheless, the issue could be reproduced by publishing Matter service without TXT entries and kicking off DNS query.

  1. Initialize the TXT entry and subtype count properly in all scenarios.
  2. Do not even process the service info object if an error was returned by OpenThread before.
  3. Extract some boilerplate to a separate function to improve readability.

Fixes #31031

OpenThread applications would crash upon receiving an empty
DNS TXT record. The reason was that the code for copying OT
DNS service info object into Matter DnssdService object
would not initialize the TXT entry count in the latter
object in such a case.

In the reported case, the Matter stack was presented an
empty TXT record because OpenThread's DNS client received
a TXT record with TTL 0 and it discarded its contents.
Nevertheless, the issue could be reproduced by publishing
Matter service without TXT entries and kicking off DNS query.

1. Initialize the TXT entry and subtype count properly in all
   scenarios.
2. Do not even process the service info object if an error was
   returned by OpenThread before.
3. Extract some boilerplate to a separate function to improve
   readability.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Copy link

github-actions bot commented Jan 3, 2024

PR #31227: Size comparison from 827f6ca to cfb6b1d

Increases (29 builds for bl702l, cc13x4_26x4, cyw30739, efr32, k32w, nrfconnect, qpg, telink)
platform target config section 827f6ca cfb6b1d change % change
bl702l lighting-app bl702l+mfd (read/write) 1164588 1165076 488 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 (read only) 772000 772016 16 0.0
.text 682176 682192 16 0.0
lock-ftd LP_EM_CC1354P10_6 (read only) 788096 788104 8 0.0
.text 704020 704028 8 0.0
lock-mtd LP_EM_CC1354P10_6 (read only) 776344 776352 8 0.0
.text 665660 665668 8 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 561383 561391 8 0.0
.app_xip_area 451569 451577 8 0.0
lock cyw930739m2evb_01 (read/write) 543623 543631 8 0.0
.app_xip_area 429073 429081 8 0.0
switch cyw930739m2evb_01 (read/write) 557791 557807 16 0.0
.app_xip_area 446209 446225 16 0.0
efr32 lighting-app BRD4187C (read/write) 1101356 1101372 16 0.0
.text 901772 901788 16 0.0
window-app BRD4187C (read/write) 1136272 1136304 32 0.0
.text 964784 964816 32 0.0
k32w contact k32w0+release (read only) 605504 605520 16 0.0
.text 604968 604984 16 0.0
light k32w0+release (read only) 595208 595224 16 0.0
.text 594672 594688 16 0.0
lock k32w0+release (read only) 576600 576616 16 0.0
.text 576064 576080 16 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1068908 1068924 16 0.0
text 786244 786256 12 0.0
qpg lighting-app qpg6105+debug (read/write) 1116940 1116956 16 0.0
.text 629316 629332 16 0.0
lock-app qpg6105+debug (read/write) 1080868 1080876 8 0.0
.text 593248 593256 8 0.0
telink air-quality-sensor-app tlsr9528a_retention (read/write) 821726 821766 40 0.0
text 614014 614054 40 0.0
all-clusters-app tlsr9518adk80d (read/write) 1087872 1087912 40 0.0
text 768100 768140 40 0.0
bridge-app tlsr9518adk80d (read/write) 935048 935088 40 0.0
text 647068 647108 40 0.0
contact-sensor-app tlsr9528a_retention (read/write) 821962 822002 40 0.0
text 614384 614424 40 0.0
light-switch-app-ota-shell-factory-data tlsr9528a (read/write) 979048 979088 40 0.0
text 694474 694514 40 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d (read/write) 1093396 1093436 40 0.0
text 769960 770000 40 0.0
lock-app-dfu tlsr9528a (read/write) 965680 965720 40 0.0
text 648150 648190 40 0.0
ota-requestor-app tlsr9518adk80d (read/write) 948724 948764 40 0.0
text 663176 663216 40 0.0
pump-app tlsr9528a (read/write) 880760 880800 40 0.0
text 622394 622434 40 0.0
pump-controller-app tlsr9518adk80d (read/write) 821372 821412 40 0.0
text 589270 589310 40 0.0
smoke_co_alarm-app tlsr9528a_retention (read/write) 823690 823730 40 0.0
text 617128 617168 40 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d (read/write) 878465 878505 40 0.0
text 631010 631050 40 0.0
thermostat tlsr9518adk80d (read/write) 845744 845784 40 0.0
text 607736 607776 40 0.0
window-covering tlsr9518adk80d (read/write) 840020 840060 40 0.0
text 601770 601810 40 0.0
Decreases (13 builds for bl702, bl702l, cc13x4_26x4, cyw30739, k32w, nrfconnect, telink)
platform target config section 827f6ca cfb6b1d change % change
bl702 lighting-app bl702 (read/write) 1183427 1183407 -20 -0.0
.text 955852 955830 -22 -0.0
bl702+mfd (read/write) 1194559 1194539 -20 -0.0
.text 967916 967894 -22 -0.0
bl702+rpc (read/write) 1275443 1275419 -24 -0.0
.text 1030914 1030892 -22 -0.0
bl702l lighting-app bl702l (read/write) 1153136 1153112 -24 -0.0
.text 948978 948956 -22 -0.0
bl702l+mfd .text 961354 961332 -22 -0.0
cc13x4_26x4 pump-app LP_EM_CC1354P10_6 (read only) 728936 728920 -16 -0.0
.text 643536 643520 -16 -0.0
pump-controller-app LP_EM_CC1354P10_6 (read only) 714480 714464 -16 -0.0
.text 633248 633232 -16 -0.0
cyw30739 ota-requestor cyw930739m2evb_01 (read/write) 562343 562327 -16 -0.0
.app_xip_area 453985 453969 -16 -0.0
k32w contact k32w1+release (read/write) 691072 691056 -16 -0.0
.text 577216 577200 -16 -0.0
light k32w1+release (read/write) 782900 782884 -16 -0.0
.text 660176 660160 -16 -0.0
nrfconnect all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1040608 1040592 -16 -0.0
text 764600 764584 -16 -0.0
telink all-clusters-minimal-app tlsr9528a text 753650 753648 -2 -0.0
shell tlsr9518adk80d (read/write) 705600 705596 -4 -0.0
text 462094 462092 -2 -0.0
Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
platform target config section 827f6ca cfb6b1d change % change
bl602 lighting-app bl602 (read/write) 1418434 1418434 0 0.0
.bss 85224 85224 0 0.0
.data 9416 9416 0 0.0
.rodata 156984 156984 0 0.0
.text 1086166 1086166 0 0.0
bl602+mfd (read/write) 1432906 1432906 0 0.0
.bss 85392 85392 0 0.0
.data 9384 9384 0 0.0
.rodata 155944 155944 0 0.0
.text 1101534 1101534 0 0.0
bl602+rpc (read/write) 1466210 1466210 0 0.0
.bss 93256 93256 0 0.0
.data 9784 9784 0 0.0
.rodata 164600 164600 0 0.0
.text 1117910 1117910 0 0.0
bl702 lighting-app bl702 (read only) 3478 3478 0 0.0
(read/write) 1183427 1183407 -20 -0.0
.bss 11197 11197 0 0.0
.data 3584 3584 0 0.0
.rodata 106356 106356 0 0.0
.text 955852 955830 -22 -0.0
bl702+mfd (read only) 3478 3478 0 0.0
(read/write) 1194559 1194539 -20 -0.0
.bss 11373 11373 0 0.0
.data 3568 3568 0 0.0
.rodata 105296 105296 0 0.0
.text 967916 967894 -22 -0.0
bl702+rpc (read only) 3478 3478 0 0.0
(read/write) 1275443 1275419 -24 -0.0
.bss 19677 19677 0 0.0
.data 4144 4144 0 0.0
.rodata 121776 121776 0 0.0
.text 1030914 1030892 -22 -0.0
bl706-eth (read/write) 1003053 1003053 0 0.0
.bss 23772 23772 0 0.0
.data 3160 3160 0 0.0
.rodata 99688 99688 0 0.0
.text 748748 748748 0 0.0
bl706-wifi (read/write) 1241310 1241310 0 0.0
.bss 10641 10641 0 0.0
.data 3600 3600 0 0.0
.rodata 120668 120668 0 0.0
.text 976162 976162 0 0.0
bl702l lighting-app bl702l (read only) 512 512 0 0.0
(read/write) 1153136 1153112 -24 -0.0
.bss 16392 16392 0 0.0
.data 4952 4952 0 0.0
.rodata 100360 100360 0 0.0
.text 948978 948956 -22 -0.0
bl702l+mfd (read/write) 1164588 1165076 488 0.0
.bss 16568 16568 0 0.0
.data 4928 4928 0 0.0
.rodata 99300 99300 0 0.0
.text 961354 961332 -22 -0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 (read only) 772000 772016 16 0.0
(read/write) 168164 168164 0 0.0
.bss 90500 90500 0 0.0
.data 3460 3460 0 0.0
.rodata 89560 89560 0 0.0
.text 682176 682192 16 0.0
lock-ftd LP_EM_CC1354P10_6 (read only) 788096 788104 8 0.0
(read/write) 178392 178392 0 0.0
.bss 100676 100676 0 0.0
.data 3488 3488 0 0.0
.rodata 83808 83808 0 0.0
.text 704020 704028 8 0.0
lock-mtd LP_EM_CC1354P10_6 (read only) 776344 776352 8 0.0
(read/write) 172848 172848 0 0.0
.bss 95132 95132 0 0.0
.data 3488 3488 0 0.0
.rodata 110416 110416 0 0.0
.text 665660 665668 8 0.0
pump-app LP_EM_CC1354P10_6 (read only) 728936 728920 -16 -0.0
(read/write) 167160 167160 0 0.0
.bss 89272 89272 0 0.0
.data 3448 3448 0 0.0
.rodata 85136 85136 0 0.0
.text 643536 643520 -16 -0.0
pump-controller-app LP_EM_CC1354P10_6 (read only) 714480 714464 -16 -0.0
(read/write) 167340 167340 0 0.0
.bss 89456 89456 0 0.0
.data 3444 3444 0 0.0
.rodata 80968 80968 0 0.0
.text 633248 633232 -16 -0.0
cc32xx air-purifier CC3235SF_LAUNCHXL (read only) 567426 567426 0 0.0
(read/write) 207716 207716 0 0.0
.bss 201180 201180 0 0.0
.data 1412 1412 0 0.0
.rodata 83970 83970 0 0.0
.text 481336 481336 0 0.0
lock CC3235SF_LAUNCHXL (read only) 620746 620746 0 0.0
(read/write) 208112 208112 0 0.0
.bss 201544 201544 0 0.0
.data 1448 1448 0 0.0
.rodata 105834 105834 0 0.0
.text 512792 512792 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 561383 561391 8 0.0
.app_xip_area 451569 451577 8 0.0
.bss 64728 64728 0 0.0
.data 660 660 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 543623 543631 8 0.0
.app_xip_area 429073 429081 8 0.0
.bss 69424 69424 0 0.0
.data 700 700 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 562343 562327 -16 -0.0
.app_xip_area 453985 453969 -16 -0.0
.bss 63344 63344 0 0.0
.data 588 588 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
switch cyw930739m2evb_01 (read/write) 557791 557807 16 0.0
.app_xip_area 446209 446225 16 0.0
.bss 66464 66464 0 0.0
.data 696 696 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A+rs9116 (read/write) 1017540 1017540 0 0.0
.bss 172664 172664 0 0.0
.data 2688 2688 0 0.0
.text 842168 842168 0 0.0
BRD4187C (read/write) 1101356 1101372 16 0.0
.bss 196268 196268 0 0.0
.data 3296 3296 0 0.0
.text 901772 901788 16 0.0
lock-app BRD4161A+wf200 (read/write) 1115200 1115200 0 0.0
.bss 188880 188880 0 0.0
.data 2712 2712 0 0.0
.text 923588 923588 0 0.0
window-app BRD4187C (read/write) 1136272 1136304 32 0.0
.bss 168300 168300 0 0.0
.data 3168 3168 0 0.0
.text 964784 964816 32 0.0
esp32 all-clusters-app c3devkit (read only) 1139076 1139076 0 0.0
(read/write) 1671916 1671916 0 0.0
.dram0.bss 72992 72992 0 0.0
.dram0.data 12996 12996 0 0.0
.flash.rodata 242056 242056 0 0.0
.flash.text 1139076 1139076 0 0.0
.iram0.text 75694 75694 0 0.0
m5stack (read only) 1184087 1184087 0 0.0
(read/write) 521100 521100 0 0.0
.dram0.bss 79648 79648 0 0.0
.dram0.data 34004 34004 0 0.0
.flash.rodata 273084 273084 0 0.0
.flash.text 1178703 1178703 0 0.0
.iram0.text 123907 123907 0 0.0
k32w contact k32w0+release (read only) 605504 605520 16 0.0
(read/write) 81960 81960 0 0.0
.bss 69808 69808 0 0.0
.data 2168 2168 0 0.0
.text 604968 604984 16 0.0
k32w1+release (read only) 1024 1024 0 0.0
(read/write) 691072 691056 -16 -0.0
.bss 67664 67664 0 0.0
.data 2716 2716 0 0.0
.text 577216 577200 -16 -0.0
light k32w0+release (read only) 595208 595224 16 0.0
(read/write) 79176 79176 0 0.0
.bss 67072 67072 0 0.0
.data 2120 2120 0 0.0
.text 594672 594688 16 0.0
k32w1+release (read only) 1024 1024 0 0.0
(read/write) 782900 782884 -16 -0.0
.bss 77340 77340 0 0.0
.data 1928 1928 0 0.0
.text 660176 660160 -16 -0.0
lock k32w0+release (read only) 576600 576616 16 0.0
(read/write) 79440 79440 0 0.0
.bss 67360 67360 0 0.0
.data 2096 2096 0 0.0
.text 576064 576080 16 0.0
linux air-purifier-app debug (read only) 2527397 2527397 0 0.0
(read/write) 127240 127240 0 0.0
.bss 46944 46944 0 0.0
.data 1472 1472 0 0.0
.data.rel.ro 72856 72856 0 0.0
.dynamic 608 608 0 0.0
.got 4552 4552 0 0.0
.init 27 27 0 0.0
.init_array 800 800 0 0.0
.rodata 179304 179304 0 0.0
.text 2172693 2172693 0 0.0
all-clusters-app debug (read only) 5421585 5421585 0 0.0
(read/write) 456696 456696 0 0.0
.bss 131760 131760 0 0.0
.data 3840 3840 0 0.0
.data.rel.ro 313832 313832 0 0.0
.dynamic 624 624 0 0.0
.got 5336 5336 0 0.0
.init 27 27 0 0.0
.init_array 1280 1280 0 0.0
.rodata 313052 313052 0 0.0
.text 4697427 4697427 0 0.0
all-clusters-minimal-app debug (read only) 4954105 4954105 0 0.0
(read/write) 234720 234720 0 0.0
.bss 127856 127856 0 0.0
.data 3776 3776 0 0.0
.data.rel.ro 95992 95992 0 0.0
.dynamic 624 624 0 0.0
.got 5296 5296 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 272461 272461 0 0.0
.text 4449187 4449187 0 0.0
bridge-app debug (read only) 4418225 4418225 0 0.0
(read/write) 215960 215960 0 0.0
.bss 119224 119224 0 0.0
.data 4704 4704 0 0.0
.data.rel.ro 85312 85312 0 0.0
.dynamic 624 624 0 0.0
.got 5264 5264 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 219157 219157 0 0.0
.text 3980499 3980499 0 0.0
chip-tool debug (read only) 11735793 11735793 0 0.0
(read/write) 505872 505872 0 0.0
.bss 94200 94200 0 0.0
.data 4994 4994 0 0.0
.data.rel.ro 399440 399440 0 0.0
.dynamic 624 624 0 0.0
.got 5784 5784 0 0.0
.init 27 27 0 0.0
.init_array 784 784 0 0.0
.rodata 426313 426313 0 0.0
.text 10616979 10616979 0 0.0
chip-tool-ipv6only arm64 (read only) 11457576 11457576 0 0.0
(read/write) 574152 574152 0 0.0
.bss 103448 103448 0 0.0
.data 4288 4288 0 0.0
.data.rel.ro 438384 438384 0 0.0
.dynamic 512 512 0 0.0
.got 19856 19856 0 0.0
.init 24 24 0 0.0
.init_array 248 248 0 0.0
.rodata 346864 346864 0 0.0
.text 10239928 10239928 0 0.0
lighting-app debug+rpc+ui (read only) 5304025 5304025 0 0.0
(read/write) 225032 225032 0 0.0
.bss 119360 119360 0 0.0
.data 4416 4416 0 0.0
.data.rel.ro 93728 93728 0 0.0
.dynamic 672 672 0 0.0
.got 5880 5880 0 0.0
.init 27 27 0 0.0
.init_array 960 960 0 0.0
.rodata 340340 340340 0 0.0
.text 4718899 4718899 0 0.0
lock-app debug (read only) 4503249 4503249 0 0.0
(read/write) 203680 203680 0 0.0
.bss 113760 113760 0 0.0
.data 3648 3648 0 0.0
.data.rel.ro 79544 79544 0 0.0
.dynamic 624 624 0 0.0
.got 5216 5216 0 0.0
.init 27 27 0 0.0
.init_array 856 856 0 0.0
.rodata 246997 246997 0 0.0
.text 4046227 4046227 0 0.0
ota-provider-app debug (read only) 4167385 4167385 0 0.0
(read/write) 192728 192728 0 0.0
.bss 113632 113632 0 0.0
.data 3904 3904 0 0.0
.data.rel.ro 69312 69312 0 0.0
.dynamic 624 624 0 0.0
.got 4528 4528 0 0.0
.init 27 27 0 0.0
.init_array 720 720 0 0.0
.rodata 201269 201269 0 0.0
.text 3774243 3774243 0 0.0
ota-requestor-app debug (read only) 4256857 4256857 0 0.0
(read/write) 197040 197040 0 0.0
.bss 114656 114656 0 0.0
.data 4176 4176 0 0.0
.data.rel.ro 72320 72320 0 0.0
.dynamic 624 624 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 205077 205077 0 0.0
.text 3855507 3855507 0 0.0
shell debug (read only) 2793833 2793833 0 0.0
(read/write) 152664 152664 0 0.0
.bss 62440 62440 0 0.0
.data 768 768 0 0.0
.data.rel.ro 83656 83656 0 0.0
.dynamic 592 592 0 0.0
.got 4088 4088 0 0.0
.init 27 27 0 0.0
.init_array 1096 1096 0 0.0
.rodata 182272 182272 0 0.0
.text 2440258 2440258 0 0.0
thermostat-no-ble arm64 (read only) 4406744 4406744 0 0.0
(read/write) 247824 247824 0 0.0
.bss 122232 122232 0 0.0
.data 2784 2784 0 0.0
.data.rel.ro 102384 102384 0 0.0
.dynamic 512 512 0 0.0
.got 12008 12008 0 0.0
.init 24 24 0 0.0
.init_array 424 424 0 0.0
.rodata 162276 162276 0 0.0
.text 3904072 3904072 0 0.0
tv-app debug (read only) 5403353 5403353 0 0.0
(read/write) 349208 349208 0 0.0
.bss 244608 244608 0 0.0
.data 4992 4992 0 0.0
.data.rel.ro 92312 92312 0 0.0
.dynamic 624 624 0 0.0
.got 5512 5512 0 0.0
.init 27 27 0 0.0
.init_array 1136 1136 0 0.0
.rodata 273141 273141 0 0.0
.text 4892371 4892371 0 0.0
tv-casting-app debug (read only) 9612017 9612017 0 0.0
(read/write) 339232 339232 0 0.0
.bss 156384 156384 0 0.0
.data 2464 2464 0 0.0
.data.rel.ro 173536 173536 0 0.0
.dynamic 624 624 0 0.0
.got 5064 5064 0 0.0
.init 27 27 0 0.0
.init_array 1144 1144 0 0.0
.rodata 363912 363912 0 0.0
.text 8782499 8782499 0 0.0
mbed lock-app-release cy8cproto_062_4343w (read only) 6224 6224 0 0.0
(read/write) 2526328 2526328 0 0.0
.bss 220280 220280 0 0.0
.data 5144 5144 0 0.0
.text 1489012 1489012 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1068908 1068924 16 0.0
bss 129488 129488 0 0.0
rodata 105580 105580 0 0.0
text 786244 786256 12 0.0
nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1194980 1194980 0 0.0
bss 121698 121698 0 0.0
rodata 139336 139336 0 0.0
text 783608 783608 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1040608 1040592 -16 -0.0
bss 129412 129412 0 0.0
rodata 98896 98896 0 0.0
text 764600 764584 -16 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 835752 835752 0 0.0
(read/write) 1752516 1752516 0 0.0
.bss 195108 195108 0 0.0
.data 2480 2480 0 0.0
.text 1546540 1546540 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 837848 837848 0 0.0
(read/write) 1706444 1706444 0 0.0
.bss 193020 193020 0 0.0
.data 2472 2472 0 0.0
.text 1502564 1502564 0 0.0
light cy8ckit_062s2_43012 (read only) 844536 844536 0 0.0
(read/write) 1631428 1631428 0 0.0
.bss 186444 186444 0 0.0
.data 2360 2360 0 0.0
.text 1434236 1434236 0 0.0
lock cy8ckit_062s2_43012 (read only) 817416 817416 0 0.0
(read/write) 1658340 1658340 0 0.0
.bss 213540 213540 0 0.0
.data 2384 2384 0 0.0
.text 1434028 1434028 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1116940 1116956 16 0.0
.bss 101280 101280 0 0.0
.data 740 740 0 0.0
.text 629316 629332 16 0.0
lock-app qpg6105+debug (read/write) 1080868 1080876 8 0.0
.bss 97576 97576 0 0.0
.data 784 784 0 0.0
.text 593248 593256 8 0.0
telink air-quality-sensor-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 821726 821766 40 0.0
bss 55096 55096 0 0.0
text 614014 614054 40 0.0
all-clusters-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1087872 1087912 40 0.0
bss 100504 100504 0 0.0
text 768100 768140 40 0.0
all-clusters-minimal-app tlsr9528a (read only) 4 4 0 0.0
(read/write) 1084416 1084416 0 0.0
bss 109828 109828 0 0.0
text 753650 753648 -2 -0.0
bridge-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 935048 935088 40 0.0
bss 94336 94336 0 0.0
text 647068 647108 40 0.0
contact-sensor-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 821962 822002 40 0.0
bss 55140 55140 0 0.0
text 614384 614424 40 0.0
light-switch-app-ota-shell-factory-data tlsr9528a (read only) 4 4 0 0.0
(read/write) 979048 979088 40 0.0
bss 79124 79124 0 0.0
text 694474 694514 40 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1093396 1093436 40 0.0
bss 99900 99900 0 0.0
text 769960 770000 40 0.0
lock-app-dfu tlsr9528a (read only) 4 4 0 0.0
(read/write) 965680 965720 40 0.0
bss 97388 97388 0 0.0
text 648150 648190 40 0.0
ota-requestor-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 948724 948764 40 0.0
bss 92444 92444 0 0.0
text 663176 663216 40 0.0
pump-app tlsr9528a (read only) 4 4 0 0.0
(read/write) 880760 880800 40 0.0
bss 69116 69116 0 0.0
text 622394 622434 40 0.0
pump-controller-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 821372 821412 40 0.0
bss 57352 57352 0 0.0
text 589270 589310 40 0.0
shell tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 705600 705596 -4 -0.0
bss 73588 73588 0 0.0
text 462094 462092 -2 -0.0
smoke_co_alarm-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 823690 823730 40 0.0
bss 55276 55276 0 0.0
text 617128 617168 40 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 878465 878505 40 0.0
bss 60828 60828 0 0.0
text 631010 631050 40 0.0
thermostat tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 845744 845784 40 0.0
bss 57648 57648 0 0.0
text 607736 607776 40 0.0
window-covering tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 840020 840060 40 0.0
bss 58000 58000 0 0.0
text 601770 601810 40 0.0

@mergify mergify bot merged commit 76b6bb5 into project-chip:master Jan 3, 2024
57 checks passed
@Damian-Nordic Damian-Nordic deleted the dnsttl0 branch January 4, 2024 07:57
Damian-Nordic added a commit to Damian-Nordic/connectedhomeip that referenced this pull request Jan 16, 2024
OpenThread applications would crash upon receiving an empty
DNS TXT record. The reason was that the code for copying OT
DNS service info object into Matter DnssdService object
would not initialize the TXT entry count in the latter
object in such a case.

In the reported case, the Matter stack was presented an
empty TXT record because OpenThread's DNS client received
a TXT record with TTL 0 and it discarded its contents.
Nevertheless, the issue could be reproduced by publishing
Matter service without TXT entries and kicking off DNS query.

1. Initialize the TXT entry and subtype count properly in all
   scenarios.
2. Do not even process the service info object if an error was
   returned by OpenThread before.
3. Extract some boilerplate to a separate function to improve
   readability.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
(cherry picked from commit 76b6bb5)
andy31415 pushed a commit that referenced this pull request Jan 18, 2024
* [app] Fix DeferredAttributePersister memory leak (#31075)

* [app] Fix DeferredAttributePerister memory leak

ScopedMemoryBuffer's Release() method was used instead of
Free(). Add CHECK_RETURN_VALUE annotation to the Release()
method to prevent from making such a mistake in the future.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>

* Code review

---------

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
(cherry picked from commit 3e8aeeb)

* [OpenThread] Harden DNS record parsing (#31227)

OpenThread applications would crash upon receiving an empty
DNS TXT record. The reason was that the code for copying OT
DNS service info object into Matter DnssdService object
would not initialize the TXT entry count in the latter
object in such a case.

In the reported case, the Matter stack was presented an
empty TXT record because OpenThread's DNS client received
a TXT record with TTL 0 and it discarded its contents.
Nevertheless, the issue could be reproduced by publishing
Matter service without TXT entries and kicking off DNS query.

1. Initialize the TXT entry and subtype count properly in all
   scenarios.
2. Do not even process the service info object if an error was
   returned by OpenThread before.
3. Extract some boilerplate to a separate function to improve
   readability.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
(cherry picked from commit 76b6bb5)
espressif-bot pushed a commit to espressif/connectedhomeip that referenced this pull request Jan 30, 2024
…ip#31457)

* [app] Fix DeferredAttributePersister memory leak (project-chip#31075)

* [app] Fix DeferredAttributePerister memory leak

ScopedMemoryBuffer's Release() method was used instead of
Free(). Add CHECK_RETURN_VALUE annotation to the Release()
method to prevent from making such a mistake in the future.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>

* Code review

---------

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
(cherry picked from commit 3e8aeeb)

* [OpenThread] Harden DNS record parsing (project-chip#31227)

OpenThread applications would crash upon receiving an empty
DNS TXT record. The reason was that the code for copying OT
DNS service info object into Matter DnssdService object
would not initialize the TXT entry count in the latter
object in such a case.

In the reported case, the Matter stack was presented an
empty TXT record because OpenThread's DNS client received
a TXT record with TTL 0 and it discarded its contents.
Nevertheless, the issue could be reproduced by publishing
Matter service without TXT entries and kicking off DNS query.

1. Initialize the TXT entry and subtype count properly in all
   scenarios.
2. Do not even process the service info object if an error was
   returned by OpenThread before.
3. Extract some boilerplate to a separate function to improve
   readability.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
(cherry picked from commit 76b6bb5)
Jerry-ESP pushed a commit to Jerry-ESP/connectedhomeip that referenced this pull request Apr 25, 2024
…ip#31457)

* [app] Fix DeferredAttributePersister memory leak (project-chip#31075)

* [app] Fix DeferredAttributePerister memory leak

ScopedMemoryBuffer's Release() method was used instead of
Free(). Add CHECK_RETURN_VALUE annotation to the Release()
method to prevent from making such a mistake in the future.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>

* Code review

---------

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
(cherry picked from commit 3e8aeeb)

* [OpenThread] Harden DNS record parsing (project-chip#31227)

OpenThread applications would crash upon receiving an empty
DNS TXT record. The reason was that the code for copying OT
DNS service info object into Matter DnssdService object
would not initialize the TXT entry count in the latter
object in such a case.

In the reported case, the Matter stack was presented an
empty TXT record because OpenThread's DNS client received
a TXT record with TTL 0 and it discarded its contents.
Nevertheless, the issue could be reproduced by publishing
Matter service without TXT entries and kicking off DNS query.

1. Initialize the TXT entry and subtype count properly in all
   scenarios.
2. Do not even process the service info object if an error was
   returned by OpenThread before.
3. Extract some boilerplate to a separate function to improve
   readability.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
(cherry picked from commit 76b6bb5)
andy31415 pushed a commit that referenced this pull request Apr 26, 2024
… v1.2-branch (#33161)

* [1.1] Cherry pick Thread DNS client and memory leak fixes (#31457)

* [app] Fix DeferredAttributePersister memory leak (#31075)

* [app] Fix DeferredAttributePerister memory leak

ScopedMemoryBuffer's Release() method was used instead of
Free(). Add CHECK_RETURN_VALUE annotation to the Release()
method to prevent from making such a mistake in the future.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>

* Code review

---------

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
(cherry picked from commit 3e8aeeb)

* [OpenThread] Harden DNS record parsing (#31227)

OpenThread applications would crash upon receiving an empty
DNS TXT record. The reason was that the code for copying OT
DNS service info object into Matter DnssdService object
would not initialize the TXT entry count in the latter
object in such a case.

In the reported case, the Matter stack was presented an
empty TXT record because OpenThread's DNS client received
a TXT record with TTL 0 and it discarded its contents.
Nevertheless, the issue could be reproduced by publishing
Matter service without TXT entries and kicking off DNS query.

1. Initialize the TXT entry and subtype count properly in all
   scenarios.
2. Do not even process the service info object if an error was
   returned by OpenThread before.
3. Extract some boilerplate to a separate function to improve
   readability.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
(cherry picked from commit 76b6bb5)

* ESP32: Add EndpointQueueFilter for ESP32 platform (#31440)

* Add EndpointQueueFilter for ESP32 platform

* Restyled by clang-format

* Restyled by gn

* fix compile error when disabling inet ipv4

* review changes

* Restyled by clang-format

* review changes

* review changes

---------

Co-authored-by: Restyled.io <commits@restyled.io>

* [ESP32] Limit number of returned WiFi scan results to configured limit (#30780)

Scan results are allocated on the heap and on a resource critical device
where heap is less, this may fail if there are a lot of APs in the
vicinity.

* [ESP32] Fix the threading issue in nimble (#29180)

* [ESP32] Fix the threading issue in nimble

Send ble connection error than executing in nimble thread context

* comment explaining why we are posting connection error event

* Adding a comment for kCHIPoBLEConnectionError

* IM: Create ReadHandler after Session Establishment for Subscription Resumption (#30491)

* IM: Create ReadHandler after Session Establishment for Subscription Resumption

* Restyled by clang-format

* Make SubscriptionResumptionHelper inherits from SubscriptionInfo

* review changes

* Rename Helper to SessionEstablisher

* Restyled by clang-format

* RAII changes

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <commits@restyled.io>

* [ESP32] Fix adding NDEBUG flag to CPPFLAGS (#30763)

In esp-idf, NDEBUG flag is added to CPPFLAGS only if assertions are
disabled. Making this inline to that.

* Add records of session establishment for subscription resumption (#31755)

* Add records of session establishment for subscription resumption

* Restyled by clang-format

* review changes

* Schedule subscription resumption when failing to establish the session in SubscriptionResumptionSessionEstablisher

* Add option to set subscription timeout resumption retry interval seconds for Linux app
Add cirque test for subscription resumption timeout

* Restyled by clang-format

* Restyled by autopep8

* Restyled by isort

* fix CI building

* Add test to the test list

* add subscription resumption restries number to SubscriptionInfo struct

* review changes

* make resumption retries persistent

* Restyled by clang-format

* ci build fixes

* try to fix cirque test

---------

Co-authored-by: Restyled.io <commits@restyled.io>

* ESP32: check ap info in IsStationConnected (#31438)

* Add checks for mOTInst in GenericThreadStackManagerImpl_OpenThread (#32482)

* Add checks for mOTInst in GenericThreadStackManagerImpl_OpenThread

* review changes

* [ESP32] Fix few attributes with fixed quality in DeviceInfoProvider (#32893)

* [ESP32] Fix few attributes with fixed quality in DeviceInfoProvider

Fixed labels, supported locales, supported calendar types were being
read from the nvs(flash) and during OTA its a hassle if one wants to
upgrade these values. Added few APIs to set the data for these
attributes in ESP32DeviceInfoProvider.

* Restyled by clang-format

* Restyled by prettier-markdown

* fix the lint errors

* Add back the original Device info provider which reads from the nvs

Add StaticESP32DeviceInfoProvider along with APIs to set data

Remove changes from example and add a guide along with usage

---------

Co-authored-by: Restyled.io <commits@restyled.io>

* Implement BLE Manager Shutdown for nimble host (#33109)

* [ESP32] Implement BLE Manager Shutdown for nimble host

- Replace ble deinit imple in Esp32AppServer with BLEMgr().Shutdown()
- Replace few ESP_LOG with ChipLog in Esp32AppServer
- Move ble deinit kCommissioningComplete switch case
- Make USE_BLE_ONLY_FOR_COMMISSIONING depends on BT_ENABLED

* Restyled by clang-format

* address reviews

* Add checks for timer handler

---------

Co-authored-by: Restyled.io <commits@restyled.io>

* [ESP32]  Made a provision to generate esp_secure_cert partition in factory partition script. (#29840)

* Made a provision to generate esp_secure_cert partition in factory partition script.

- Added the provision to generate esp_secure_cert_partition based on option --dac-in-secure-cert.
- Refactored some code of the existing script - made it more modular.

* made outdir user governed

* Added the support for onboarding paylaod in factory script (#31274)

---------

Co-authored-by: Damian Królik <66667989+Damian-Nordic@users.noreply.github.com>
Co-authored-by: Wang Qixiang <43193572+wqx6@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Shubham Patil <shubham.patil@espressif.com>
Co-authored-by: shripad621git <79364691+shripad621git@users.noreply.github.com>
maciejbaczmanski pushed a commit to maciejbaczmanski/connectedhomeip that referenced this pull request Jul 15, 2024
)

OpenThread applications would crash upon receiving an empty
DNS TXT record. The reason was that the code for copying OT
DNS service info object into Matter DnssdService object
would not initialize the TXT entry count in the latter
object in such a case.

In the reported case, the Matter stack was presented an
empty TXT record because OpenThread's DNS client received
a TXT record with TTL 0 and it discarded its contents.
Nevertheless, the issue could be reproduced by publishing
Matter service without TXT entries and kicking off DNS query.

1. Initialize the TXT entry and subtype count properly in all
   scenarios.
2. Do not even process the service info object if an error was
   returned by OpenThread before.
3. Extract some boilerplate to a separate function to improve
   readability.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
maciejbaczmanski pushed a commit to maciejbaczmanski/connectedhomeip that referenced this pull request Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

[BUG] Matter Thread Accessory Crash Due to Corner Case(TTL=0)
5 participants