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

pkcs11_1007: close session before trying new ones #758

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

etienne-lms
Copy link
Contributor

Close opened session after secure service memory is exhausted before testing closure on invalid session. This change attempts to fix a non systematic issue found as described in [1].

A test case is slightly changed: where a likely invalid session ID (valid ID + 1024) was tried to be closed, this change now tries to close a session that has been already closed.

Link: OP-TEE/optee_os#6952 [1]

@etienne-lms
Copy link
Contributor Author

Note that I'm not 100% this change will fix OP-TEE/optee_os#6952. At least it should not be harmful.

Copy link
Contributor

@jenswi-linaro jenswi-linaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acked-by: Jens Wiklander <jens.wiklander@linaro.org>

rv = C_CloseSession(~0);
ADBG_EXPECT_CK_RESULT(c, CKR_SESSION_HANDLE_INVALID, rv);


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove one of the empty lines.

Close opened sessions after secure service memory is exhausted before
testing closure on invalid session. This change attempts to fix a
non systematic issue found as described in [1].

A test case is slightly changed: where a likely invalid session
ID (valid ID + 1024) was tried to be closed, this change now
tries to close a session that has been already closed.

Link: OP-TEE/optee_os#6952 [1]
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
@etienne-lms
Copy link
Contributor Author

Comment addresses + fix commit message (s/session/sessions/ x2) + apply review tag.

@jforissier jforissier merged commit 695231e into OP-TEE:master Sep 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants