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

ukvm: Multiple issues with ELF loader #126

Closed
mato opened this issue Nov 22, 2016 · 2 comments
Closed

ukvm: Multiple issues with ELF loader #126

mato opened this issue Nov 22, 2016 · 2 comments
Assignees
Labels

Comments

@mato
Copy link
Member

mato commented Nov 22, 2016

While reviewing #123 and trying to write a test to go into tests/ for #73 I found (at least) the following issues with the ELF loader in ukvm:

  1. In load_code() the test for a loadable segment is incorrect, phdr.p_type is not a bitmap.
  2. Return values from mprotect() are not checked.
  3. The mprotect() call which is supposed to write-protect .text is passed a len which is not a multiple of the page size.
  4. (related) Trying to write to a global char * in the guest produces an EFAULT exit from KVM_RUN where it should succeed.

I'm working on auditing that code and fixing the above.

@mato mato added the bug label Nov 22, 2016
@mato mato self-assigned this Nov 22, 2016
mato added a commit to mato/solo5 that referenced this issue Nov 23, 2016
General cleanup and audit in load_code().  Fixes Solo5#126, removes
unnecessary casts and verifies that the load address/sizes in program
header are valid.

The guard page at the end of the last loaded segment is removed; it
didn't serve any useful function.
@mato mato mentioned this issue Nov 23, 2016
@mato mato closed this as completed in #127 Nov 23, 2016
@mato
Copy link
Member Author

mato commented Nov 23, 2016

Not quite done yet, need to address #127 (comment)

@mato mato reopened this Nov 23, 2016
@mato
Copy link
Member Author

mato commented Nov 28, 2016

With #129 merged, this is done now.

@mato mato closed this as completed Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant