Skip to content

Conversation

@Kswin01
Copy link

@Kswin01 Kswin01 commented Oct 21, 2025

This RFC proposes to enforce the same over-map behaviour of the page map invocation across all architectures. That is,
prevent over-mapping on all architectures.

A draft implementation for preventing overmapping can be found here: seL4/seL4#1526.
The associated sel4test changes/additions can be found here: seL4/sel4test#148.

@Kswin01 Kswin01 force-pushed the 0210-overmap branch 2 times, most recently from 5bbb757 to 1d630e6 Compare October 21, 2025 04:08
@lsf37
Copy link
Member

lsf37 commented Oct 21, 2025

My main question on this is: why not change the behaviour of RISC-V and allow overmapping everywhere? It is the smaller change and is more permissive. And it is perfectly safe from the kernel's perspective.

Overmapping will create FrameCaps with stale mapping information, but deleting page tables already does the same, so the kernel still has to deal with the issue.

I don't think we should restrict behaviour if we don't need to.

@Kswin01
Copy link
Author

Kswin01 commented Oct 22, 2025

Yep, that's a valid approach as well that I mentioned in the alternatives section. I have no strong feelings either way, whether that be allowing or preventing over-mapping on all architectures. The change will be a lot simpler for allowing over-mapping on RISCV, and in my mind it would impact less existing users.

@Indanz
Copy link
Contributor

Indanz commented Oct 22, 2025

The argument against allowing overmapping is that in 99% of cases when it happens, it's done accidentally, and debugging this mistake is hard. Not allowing it would make seL4 more user friendly. For the 1% of cases where it is done deliberately, people can easily unmap before remapping. (Edit: But a debug print would solve this issue though.)

Another argument is that with the current convoluted API you need both a VSpace cap and a page cap to control a VSpace. If you allow overmapping, you can effectively revoke someone else's page cap without having access to it. Deleting page tables is not the same, as those have explicit control over a subset of the virtual address space.

But if the goal is consistency, then allowing it on RISCV is indeed the more practical solution.

@lsf37
Copy link
Member

lsf37 commented Dec 2, 2025

Considering the verification cost for the change, I think adjusting RISC-V so that it aligns with the other architectures instead of disallowing overmapping is the right choice.

Basically, I can verify the removal of the RISC-V check on the side without too much effort, but the added checks proposed in the draft implementation are more work. We'd need to include that in some funded project somewhere and I don't see the change making sense for hiding under ifdef.

The revoke caveat is already documented as such for all other architectures and you do need a VSpace cap to get there, which means you already have authority over the VSpace and can do worse things to it (which is why this is passing integrity and confidentiality proofs).

@lsf37
Copy link
Member

lsf37 commented Dec 15, 2025

The TSC meeting on 3 Dec 2026 deferred approval on this RFC, but encourages progress for

  • adding over-mapping checks on the remaining platforms
  • while allowing access rights upgrade/downgrade
  • approval will need a verification plan

When a corresponding implementation PR is available, Gerwin volunteered to estimate verification effort.

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