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

Internal malloc and various improvements #27

Merged
merged 1 commit into from
Apr 25, 2024
Merged

Conversation

0152la
Copy link
Contributor

@0152la 0152la commented Apr 18, 2024

Since this has quite a bit of changes, including lots of removals, I decided to open the PR as multiple commits, to make reviewing easier.

  • Provide a malloc and friends compartment library to be used
    internally, overriding the previous interception implementation. We
    use the DDC capability to get the are of memory that is designated as
    heap space. This is done in a new library, libcomputils.so, to be
    loaded in a compartment. This means further libraries loaded will also
    use our own internal malloc implementation;
  • Due to the above, now removed most of the intercept code; leftover
    code is meant to be rechecked and reworked at some point;
  • Fix setting improper bounds for compartment DDC capabilities (i.e.,
    ensure the capability encompasses only the memory region designated
    for a compartment), and now set the offset to match the start of the
    compartment heap, to use for internal malloc;
  • Further improve symbol relocation lookup;
  • Added a few more tests.

@0152la 0152la requested a review from ltratt April 18, 2024 14:29
@ltratt
Copy link
Contributor

ltratt commented Apr 20, 2024

Somehow I missed this one -- sorry!

tests/simple_fopen.c Outdated Show resolved Hide resolved
@ltratt
Copy link
Contributor

ltratt commented Apr 22, 2024

bd73088 says "Remove some currently not working tests" but it adds two tests and removes none?

@0152la
Copy link
Contributor Author

0152la commented Apr 22, 2024

bd73088 says "Remove some currently not working tests" but it adds two tests and removes none?

I think I forgot to add CMakeLists.txt in that commit, and that got added in 06b708a.

@ltratt
Copy link
Contributor

ltratt commented Apr 22, 2024

Please squash.

@0152la
Copy link
Contributor Author

0152la commented Apr 22, 2024

Squashed.

@ltratt ltratt added this pull request to the merge queue Apr 22, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 22, 2024
@ltratt
Copy link
Contributor

ltratt commented Apr 24, 2024

@0152la I guess the new commit fixes things and this can be squashed? If so, please squash.

@0152la
Copy link
Contributor Author

0152la commented Apr 25, 2024

I wanted to do a bit further testing before going forward with this PR, in case anything else slipped through the cracks. I'll either squash it, or push further commits, based on how it goes.

@0152la
Copy link
Contributor Author

0152la commented Apr 25, 2024

Ready for review.

@ltratt
Copy link
Contributor

ltratt commented Apr 25, 2024

Please squash.

* Provide a `malloc` and friends compartment library to be used
  internally, overriding the previous interception implementation. We
  use the DDC capability to get the are of memory that is designated as
  heap space. This is done in a new library, `libcomputils.so`, to be
  loaded in a compartment. This means further libraries loaded will also
  use our own internal `malloc` implementation;
* Due to the above change, we also remove old intercept stuff, as that
  has been completely outdated by newer features (might come back for
  inter-compartment calls);
* Fix setting improper bounds for compartment DDC capabilities (i.e.,
  ensure the capability encompasses only the memory region designated
  for a compartment), and now set the offset to match the start of the
  compartment heap, to use for internal `malloc`;
* Further improve symbol relocation lookup, including support for "raw"
  relocations that refer only to addresses, not to a given symbol.
@0152la
Copy link
Contributor Author

0152la commented Apr 25, 2024

Squashed.

@ltratt ltratt added this pull request to the merge queue Apr 25, 2024
Merged via the queue into capablevms:master with commit a5b7365 Apr 25, 2024
2 checks passed
@0152la 0152la deleted the printf branch June 3, 2024 11:29
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.

2 participants