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

core: fix OOM handling in tee_svc_storage_read_head() #2316

Merged
merged 1 commit into from
May 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions core/tee/tee_svc_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,12 @@ static TEE_Result tee_svc_storage_read_head(struct tee_obj *o)
bytes = head.attr_size;
res = fops->read(o->fh, sizeof(struct tee_svc_storage_head),
attr, &bytes);
if (res != TEE_SUCCESS || bytes != head.attr_size) {
if (res == TEE_ERROR_OUT_OF_MEMORY)
goto exit;
if (res != TEE_SUCCESS || bytes != head.attr_size)
res = TEE_ERROR_CORRUPT_OBJECT;
if (res)
goto exit;
}
}

res = tee_obj_attr_from_binary(o, attr, head.attr_size);
Expand Down