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 SecureSession being made defunct after expiration #23097

Merged

Conversation

mrjerryjohns
Copy link
Collaborator

Fixes #23093

When an UpdateNOC call is received on the server, it expires the associated session and proceeds to send back a response on the associated exchange. If response fails to get ACK'ed, it will result in the session being marked defunct. The SecureSession logic over-aggressively asserts on marking expired sessions as defunct, causing a VerifyOrDie crash to happen.

Fix:
Remove the VerifyOrDie

Testing:
Added a test in TestAbortExchangesForFabric to catch this scenario. Also pivoted most of the secure sessions in those test to be of type CASE to facilitate correctly triggering the various bits of logic in ExchangeMgr and ReliableMessageMgr in these scenarios.

When an UpdateNOC call is received on the server, it expires the
associated session and proceeds to send back a response on the
associated exchange. If response fails to get ACK'ed, it will result in
the session being marked defunct. The SecureSession logic
over-aggressively asserts on marking expired sessions as defunct,
causing a VerifyOrDie crash to happen.

Fix:
Remove the VerifyOrDie

Testing:
Added a test in TestAbortExchangesForFabric to catch this scenario. Also
pivoted most of the secure sessions in those test to be of type CASE to
facilitate correctly triggering the various bits of logic in ExchangeMgr
and ReliableMessageMgr in these scenarios.
@github-actions
Copy link

PR #23097: Size comparison from 119cdf5 to 45e4e75

Decreases (7 builds for bl702, qpg, telink)
platform target config section 119cdf5 45e4e75 change % change
bl702 lighting-app bl702 (read/write) 1188659 1188643 -16 -0.0
.debug_info 37905288 37905257 -31 -0.0
.debug_line 5256840 5256750 -90 -0.0
.text 957032 957022 -10 -0.0
bl702+rpc .debug_info 41811901 41811871 -30 -0.0
.debug_line 5631375 5631285 -90 -0.0
.text 1030734 1030726 -8 -0.0
qpg lighting-app qpg6105+debug (read/write) 1148656 1148648 -8 -0.0
.text 595756 595748 -8 -0.0
lock-app qpg6105+debug (read/write) 1113720 1113712 -8 -0.0
.text 560816 560808 -8 -0.0
telink light-switch-app tlsr9518adk80d (read/write) 789372 789364 -8 -0.0
text 553144 553138 -6 -0.0
lighting-app tlsr9518adk80d (read/write) 811484 811476 -8 -0.0
text 571366 571360 -6 -0.0
ota-requestor-app tlsr9518adk80d (read/write) 819420 819412 -8 -0.0
text 577548 577540 -8 -0.0
Full report (7 builds for bl702, qpg, telink)
platform target config section 119cdf5 45e4e75 change % change
bl702 lighting-app bl702 0 0 0 0.0
(read only) 3262 3262 0 0.0
(read/write) 1188659 1188643 -16 -0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 67102 67102 0 0.0
.bss_psram 29696 29696 0 0.0
.comment 48 48 0 0.0
.data 4272 4272 0 0.0
.debug_abbrev 1506865 1506865 0 0.0
.debug_aranges 133128 133128 0 0.0
.debug_frame 486580 486580 0 0.0
.debug_info 37905288 37905257 -31 -0.0
.debug_line 5256840 5256750 -90 -0.0
.debug_loc 3367112 3367112 0 0.0
.debug_ranges 359368 359368 0 0.0
.debug_str 3457811 3457811 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 144 144 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 116744 116744 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 565071 565071 0 0.0
.symtab 171664 171664 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 957032 957022 -10 -0.0
bl702+rpc 0 0 0 0.0
(read only) 3262 3262 0 0.0
(read/write) 1284579 1284579 0 0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 75150 75150 0 0.0
.bss_psram 29936 29936 0 0.0
.comment 48 48 0 0.0
.data 4800 4800 0 0.0
.debug_abbrev 1644410 1644410 0 0.0
.debug_aranges 140632 140632 0 0.0
.debug_frame 511956 511956 0 0.0
.debug_info 41811901 41811871 -30 -0.0
.debug_line 5631375 5631285 -90 -0.0
.debug_loc 3559772 3559772 0 0.0
.debug_ranges 381824 381824 0 0.0
.debug_str 3853711 3853711 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 160 160 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 130136 130136 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 624244 624244 0 0.0
.symtab 189472 189472 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 1030734 1030726 -8 -0.0
qpg lighting-app qpg6105+debug (read/write) 1148656 1148648 -8 -0.0
.bss 110556 110556 0 0.0
.data 832 832 0 0.0
.text 595756 595748 -8 -0.0
lock-app qpg6105+debug (read/write) 1113720 1113712 -8 -0.0
.bss 106372 106372 0 0.0
.data 836 836 0 0.0
.text 560816 560808 -8 -0.0
telink light-switch-app tlsr9518adk80d (read/write) 789372 789364 -8 -0.0
bss 72480 72480 0 0.0
noinit 43520 43520 0 0.0
text 553144 553138 -6 -0.0
lighting-app tlsr9518adk80d (read/write) 811484 811476 -8 -0.0
bss 73328 73328 0 0.0
noinit 43520 43520 0 0.0
text 571366 571360 -6 -0.0
ota-requestor-app tlsr9518adk80d (read/write) 819420 819412 -8 -0.0
bss 74236 74236 0 0.0
noinit 43520 43520 0 0.0
text 577548 577540 -8 -0.0

@andy31415 andy31415 merged commit 973bbf5 into project-chip:master Oct 11, 2022
selissia pushed a commit to selissia/connectedhomeip that referenced this pull request Oct 12, 2022
…3097)

When an UpdateNOC call is received on the server, it expires the
associated session and proceeds to send back a response on the
associated exchange. If response fails to get ACK'ed, it will result in
the session being marked defunct. The SecureSession logic
over-aggressively asserts on marking expired sessions as defunct,
causing a VerifyOrDie crash to happen.

Fix:
Remove the VerifyOrDie

Testing:
Added a test in TestAbortExchangesForFabric to catch this scenario. Also
pivoted most of the secure sessions in those test to be of type CASE to
facilitate correctly triggering the various bits of logic in ExchangeMgr
and ReliableMessageMgr in these scenarios.
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.

[BUG] UpdateNOC followed by MRP timeout leads to VerifyOrDie
3 participants