File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -435,9 +435,15 @@ static void tfm_svcall_psa_set_rhandle(uint32_t *args)
435
435
tfm_panic ();
436
436
}
437
437
438
- if (tfm_spm_set_rhandle (msg -> service , msg -> handle ,
439
- rhandle ) != IPC_SUCCESS ) {
440
- tfm_panic ();
438
+ /*
439
+ * Connection handle is not created while SP is processing PSA_IPC_CONNECT
440
+ * message. Store reverse handle temporarily and re-set it after the
441
+ * connection created.
442
+ */
443
+ if (msg -> handle != PSA_NULL_HANDLE ) {
444
+ tfm_spm_set_rhandle (msg -> service , msg -> handle , rhandle );
445
+ } else {
446
+ msg -> msg .rhandle = rhandle ;
441
447
}
442
448
}
443
449
@@ -744,6 +750,11 @@ static void tfm_svcall_psa_reply(uint32_t *args)
744
750
tfm_panic ();
745
751
}
746
752
ret = connect_handle ;
753
+
754
+ /* Set reverse handle after connection created if needed. */
755
+ if (msg -> msg .rhandle ) {
756
+ tfm_spm_set_rhandle (service , connect_handle , msg -> msg .rhandle );
757
+ }
747
758
} else if (status == PSA_CONNECTION_REFUSED ) {
748
759
ret = PSA_CONNECTION_REFUSED ;
749
760
} else if (status == PSA_CONNECTION_BUSY ) {
You can’t perform that action at this time.
0 commit comments