Skip to content

libutee: validate TEE_ReadObjectData output buffer - #7983

Merged
jenswikl merged 1 commit into
OP-TEE:masterfrom
GSoJC234:fix/storage-read-object-data-private-output
Sep 9, 2026
Merged

jenswikl merged 1 commit into
OP-TEE:masterfrom
GSoJC234:fix/storage-read-object-data-private-output

Conversation

@GSoJC234

@GSoJC234 GSoJC234 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Check the data buffer against the [out] annotation before reading persistent-object data. This prevents client-shared memory from being used where the API requires a private TA output buffer.

The count output was already validated; validate the data output as well.

@GSoJC234

GSoJC234 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

A corresponding regression test has been added in optee_test: OP-TEE/optee_test#833

@jenswikl

jenswikl commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Since this is a fix, please add a fixes tag, probably:
Fixes: 6915bbb ("GP 1.1: Check parameters annotated in the specification")

With that:
Reviewed-by: Jens Wiklander <jens.wiklander@oss.qualcomm.com>

@GSoJC234
GSoJC234 force-pushed the fix/storage-read-object-data-private-output branch from 9a0b651 to a1b98ce Compare September 3, 2026 12:39
@GSoJC234

GSoJC234 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I've added the Fixes and Reviewed-by tags.

@jenswikl

jenswikl commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

I'll merge this when the CI tests have passed.

@GSoJC234
GSoJC234 force-pushed the fix/storage-read-object-data-private-output branch from a1b98ce to fe10fc9 Compare September 4, 2026 02:05
@jenswikl

jenswikl commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

It appears there's a problem with secure_storage-rs, probably due to using shared memory, which this PR tightens up the checks for. @ivila can you check, please?

@ivila

ivila commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

It appears there's a problem with secure_storage-rs, probably due to using shared memory, which this PR tightens up the checks for. @ivila can you check, please?

Yes,will do

@ivila

ivila commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

It appears there's a problem with secure_storage-rs, probably due to using shared memory, which this PR tightens up the checks for. @ivila can you check, please?

Fixes by OP-TEE/manifest#356

@jenswikl

jenswikl commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Hopefully, CI tests should pass now.

@jenswikl

jenswikl commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Rebase and force push the change. I think there's some cache issue that usually gets resolved by that.

Check the data buffer against the [out] annotation before reading
persistent-object data. This prevents client-shared memory from being
used where the API requires a private TA output buffer.

The count output was already validated; validate the data output as well.

Fixes: 6915bbb ("GP 1.1: Check parameters annotated in the specification")
Signed-off-by: Jaehun Lee <gsojc234@gmail.com>
Reviewed-by: Jens Wiklander <jens.wiklander@oss.qualcomm.com>
@GSoJC234
GSoJC234 force-pushed the fix/storage-read-object-data-private-output branch from fe10fc9 to a5aa4e3 Compare September 8, 2026 14:04
@jenswikl
jenswikl merged commit 06ba976 into OP-TEE:master Sep 9, 2026
58 checks 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