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

Libraries should be compiled with CHERIOT_NO_AMBIENT_MALLOC #322

Open
PhilDay-CT opened this issue Oct 25, 2024 · 2 comments
Open

Libraries should be compiled with CHERIOT_NO_AMBIENT_MALLOC #322

PhilDay-CT opened this issue Oct 25, 2024 · 2 comments

Comments

@PhilDay-CT
Copy link
Contributor

Currently it's possible to define a malloc capability in code that gets compiled into a library, in effect giving a library a heap quota even if the compartment that includes the library is defined not to have heap quota.

xmake rules for libraries should be updated to compile with CHERIOT_NO_AMBIENT_MALLOC defined

rule("cheriot.library")

@davidchisnall
Copy link
Collaborator

Putting the define in will still make it possible (though you can prevent it via policy and we should add some rules for doing this), but it will make the default sensible.

@davidchisnall
Copy link
Collaborator

When we're building a compartment, I think the compiler puts the compartment name in a #define, so an alternative here would be for stdlib.h to flip the default depending on whether the define is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants