-
Notifications
You must be signed in to change notification settings - Fork 41
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
implement shadow stacks #455
Commits on Oct 25, 2024
-
mm: don't set DIRTY without WRITABLE
When CET is enabled, pages marked as DIRTY but not WRITABLE are treated as special pages used for storing shadow stacks. We must not use this combination of flags for pages not meant to be used for shadow stacks. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for de3d68f - Browse repository at this point
Copy the full SHA de3d68fView commit details -
mm: implement VMKernelShadowStack
The initialization and pt_flags are a bit special for shadow stack pages, so this warrants a new `VirtualMapping` implementations. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1e81471 - Browse repository at this point
Copy the full SHA 1e81471View commit details -
percpu: allocate an initial shadow stack
This shadow stack is used when not using a task's shadow stack. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e41469a - Browse repository at this point
Copy the full SHA e41469aView commit details -
The interrupt shadow stack table (ISST) is very similar to the interrupt stack table (IST) except that it contains shadow stack addresses instead of normal stack addresses. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fd5aa4e - Browse repository at this point
Copy the full SHA fd5aa4eView commit details -
task: allocate shadow stacks for each task
Each task needs to a normal shadow stack and shadow stack used for exception handling. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f2a4429 - Browse repository at this point
Copy the full SHA f2a4429View commit details -
idt: add shadow stack pointer to exception context
Some exception handlers will need to update the shadow stack, so they need to know the shadow stack pointer at the time of the exception. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dae1da4 - Browse repository at this point
Copy the full SHA dae1da4View commit details -
idt: update return address on shadow stack
Whenever we update the return address on the shadow stack, we'll also need to update the return address on the shadow stack. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e296721 - Browse repository at this point
Copy the full SHA e296721View commit details -
idt: fixup shadow stack in #HV handler
The #HV handler messes with the stack frame and shadow stack needs to be adjusted accordingly. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5d21228 - Browse repository at this point
Copy the full SHA 5d21228View commit details -
address: add VirtAddr::as_usize
Unlike the various From and Into implementations, this method can be called in const contexts. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6029dce - Browse repository at this point
Copy the full SHA 6029dceView commit details -
schedule: switch to special stack during context switches
We need to guard against IRQs coming in after switching to the new page tables and before switching to the new stack. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a448d45 - Browse repository at this point
Copy the full SHA a448d45View commit details -
schedule: switch shadow stacks in context switch
Each task has separate shadow stacks, so we need to switch them when switching tasks. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7c4b93f - Browse repository at this point
Copy the full SHA 7c4b93fView commit details -
This enables shadow stacks for the BSP. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 34ac60b - Browse repository at this point
Copy the full SHA 34ac60bView commit details -
This enables shadow stacks on the secondary APs. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8b6619c - Browse repository at this point
Copy the full SHA 8b6619cView commit details -
This exception handler will be executed when the CPU detects a mismatch between the return address on the stack and the return address on the shadow stack. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a66514a - Browse repository at this point
Copy the full SHA a66514aView commit details -
shadow_stack: determine support at runtime
Trusted CPUID values are hard to come by, so let's just try to enable CET in CR4 and handle failure gracefully. Signed-off-by: Tom Dohrmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9de01ca - Browse repository at this point
Copy the full SHA 9de01caView commit details
Commits on Nov 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 5f95269 - Browse repository at this point
Copy the full SHA 5f95269View commit details