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

Move struct pcb out of kernel stack. #2273

Open
qwattash opened this issue Dec 19, 2024 · 1 comment
Open

Move struct pcb out of kernel stack. #2273

qwattash opened this issue Dec 19, 2024 · 1 comment

Comments

@qwattash
Copy link
Contributor

Currently struct pcb is allocated by stealing a chunk of the kernel stack. There are two issues in the current implementation.

  1. We are not setting bounds on struct pcb
  2. Setting bounds on struct pcb requires dealing with representability and padding.

By moving struct pcb to a separate allocation we avoid having to deal with representability issues and prevent overflow into pcb from a kernel stack pointer.

@bsdjhb
Copy link
Collaborator

bsdjhb commented Dec 19, 2024

Note that upstream FreeBSD already allocates the pcb separately for amd64 (it is allocated as a member of td_md). We can probably do similar changes for arm64 and riscv64 upstream and then loop those back into CheriBSD to reduce our diff.

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