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

determine whether invalid %fs (via clone or arch_prctl(ARCH_SET_FS)) undermines compartmentalization #291

Open
Tracked by #233
fw-immunant opened this issue Sep 25, 2023 · 1 comment

Comments

@fw-immunant
Copy link
Contributor

fw-immunant commented Sep 25, 2023

Split out of #233.

My concern is that if a hostile compartment A changes %fs before the victim compartment B looks for a TLS variable (by accessing the DTV via the TCB pointer at by %fs, then the latter compartment will look in the wrong place, effectively letting compartment A choose which values compartment B sees for its TLS variables. I think we need to forbid arch_prctl(ARCH_SET_FS) in our syscall filtering, which we could do in seccomp BPF.

This should be pretty self-contained, and a fix should include a PoC along with the fix.

@fw-immunant
Copy link
Contributor Author

We may actually not be able to do this in seccomp BPF as BPF is stateless and we need to allow the first call in the program which is performed by glibc threading setup. Successive threads get their values of %fs from clone()... which may also be a problem if a hostile compartment performs clone() directly instead of going through pthread_create().

@fw-immunant fw-immunant changed the title determine whether arch_prctl(ARCH_SET_FS) corrupting TLS undermines compartmentalization determine whether invalid %fs (via clone or arch_prctl(ARCH_SET_FS)) undermines compartmentalization Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant