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 offset in assign_mobj_to_param_mem() #2430

Merged
merged 1 commit into from
Jun 28, 2018

Conversation

jenswi-linaro
Copy link
Contributor

Prior to this patch assign_mobj_to_param_mem() stored the offset
supplied with a non-contiguous buffer in mem->offs. Since that offset
already is stored inside the resulting MOBJ that offset is added twice.
This patch fixes this by initializing mem->offs to 0 instead.

Signed-off-by: Jens Wiklander [email protected]

@jforissier
Copy link
Contributor

Do you expect this should fix #2414? It certainly looks like it does :)

@lorc
Copy link
Contributor

lorc commented Jun 27, 2018

Hm, I wonder how it worked prior to this fix...

I certainly had issues with offsets when I worked on non-contig buffers. And at that time I had to use offset. Looks like something have changed later.

@jenswi-linaro
Copy link
Contributor Author

This part of the code is never triggered with the Linux driver, but I can't recall why at the moment. I was discovering this while hacking on TEE Client implementation for U-boot.

I don't expect it to fix #2414.

@lorc
Copy link
Contributor

lorc commented Jun 27, 2018

Ah, yes, right. I played with non-contig buffers a long ago. Maybe I missed this issue then. Anyways, it looks like right fix.

Reviewed-by: Volodymyr Babchuk <[email protected]>

Prior to this patch assign_mobj_to_param_mem() stored the offset
supplied with a non-contiguous buffer in mem->offs. Since that offset
already is stored inside the resulting MOBJ that offset is added twice.
This patch fixes this by initializing mem->offs to 0 instead.

Reviewed-by: Volodymyr Babchuk <[email protected]>
Signed-off-by: Jens Wiklander <[email protected]>
@jenswi-linaro
Copy link
Contributor Author

Tag applied

@jforissier jforissier merged commit a0c3590 into OP-TEE:master Jun 28, 2018
@jenswi-linaro jenswi-linaro deleted the noncontig_fix branch June 28, 2018 12:16
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