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

Possibly incorrect allocation in function pp_alloc_clr #199

Open
nkosmatov opened this issue Dec 26, 2024 · 1 comment
Open

Possibly incorrect allocation in function pp_alloc_clr #199

nkosmatov opened this issue Dec 26, 2024 · 1 comment

Comments

@nkosmatov
Copy link

While working on formal verification of cache coloring and page coloring mechanisms in Bao, we discovered two issues in function pp_alloc_clr

The following line (currently line 138 in commit c306b0f in file src/core/mmu/mem.c)
index ++;

should be removed. Otherwise , in some situations, a previously allocated page can be allocated again, or other unintended behavior can occur.

The following line (currently line 161 in commit c306b0f in file src/core/mmu/mem.c)
index = 0;
should be replaced by
index = pp_next_clr ( pool->base , 0 , colors ) ;
Otherwise , in some situations, a previously allocated page can be allocated again.

After the proposed modifications we were able to prove a (slightly simplified) corrected version of cache coloring and page coloring mechanisms in Bao.

@josecm
Copy link
Member

josecm commented Dec 26, 2024

Hello @nkosmatov!

After the proposed modifications we were able to prove a (slightly simplified) corrected version of cache coloring and page coloring mechanisms in Bao.

This is amazing!! Thank you for doing that work.

Your corrections seem to make sense. I'd propose you send a PR with the fixes you point out.

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

No branches or pull requests

2 participants