Skip to content

Conversation

@Finder16
Copy link

fix bug

@jforissier
Copy link
Contributor

Thanks for the patch. Please provide a proper commit subject and description.

@Finder16
Copy link
Author

Copies only the smaller of the plugin’s reported output length (outlen) and the requested length into the core/user buffers, preventing leftover heap data from leaking when the response is shorter than len

@jforissier
Copy link
Contributor

Copies only the smaller of the plugin’s reported output length (outlen) and the requested length into the core/user buffers, preventing leftover heap data from leaking when the response is shorter than len

Excellent. I'd like to see this in the git commit description.

@Finder16
Copy link
Author

done

@jforissier
Copy link
Contributor

One more thing, we also require authors to provide a Signed-off-by. Please see: https://optee.readthedocs.io/en/latest/general/contribute.html

@Finder16
Copy link
Author

Is this the correct way to do it?

@jforissier
Copy link
Contributor

Is this the correct way to do it?

Please run:

git config user.name "Jaeyeong Lee"
git config user.email "[email protected]"
git commit --amend -s --reset-author

This will set the Git Author field properly and in addition it will append a Signed-off-by: tag.

…an requested

Copies only the smaller of the plugin’s reported output length (outlen)
and the requested length. This prevents leaking leftover secure-world
heap data when the plugin returns fewer bytes than the caller requested.

Previously, tee_invoke_supp_plugin_rpc() copied `len` bytes regardless of
the actual number of bytes produced by the plugin, resulting in kernel /
secure heap disclosure into the REE.

Signed-off-by: Jaeyeong Lee <[email protected]>
@Finder16
Copy link
Author

done

@jenswi-linaro
Copy link
Contributor

Copies only the smaller of the plugin’s reported output length (outlen)
and the requested length. This prevents leaking leftover secure-world
heap data when the plugin returns fewer bytes than the caller requested.

Previously, tee_invoke_supp_plugin_rpc() copied len bytes regardless of
the actual number of bytes produced by the plugin, resulting in kernel /
secure heap disclosure into the REE.

I don't see how kernel or secure heap is leaked. This copies from shared memory allocated by the tee-supplicant. Unless I've misunderstood it, the worst case is leaking tee-supplicant heap.

*outlen = params[2].u.value.b;

if (len && outlen && *outlen) {
size_t resp_len = *outlen;
Copy link
Contributor

Choose a reason for hiding this comment

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

size_t resp_len = MIN(*outlen, len);

@github-actions
Copy link

This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

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