| b1e1bd2e | 02-Jun-2025 |
Benjamin Berg <benjamin@sipsolutions.net> |
um: Add helper functions to get/set state for SECCOMP
When not using ptrace, we need to both save and restore registers through the mcontext as provided by the host kernel to our signal handlers.
A
um: Add helper functions to get/set state for SECCOMP
When not using ptrace, we need to both save and restore registers through the mcontext as provided by the host kernel to our signal handlers.
Add corresponding functions to store the state to an mcontext and helpers to access the mcontext of the subprocess through the stub data.
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net> Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Link: https://patch.msgid.link/20250602130052.545733-4-benjamin@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
show more ...
|
| 14d4a7b5 | 22-Oct-2024 |
Johannes Berg <johannes.berg@intel.com> |
um: make stub_exe _start() pure inline asm
Since __attribute__((naked)) cannot be used with functions containing C statements, just generate the few instructions it needs in assembly directly.
Whil
um: make stub_exe _start() pure inline asm
Since __attribute__((naked)) cannot be used with functions containing C statements, just generate the few instructions it needs in assembly directly.
While at it, fix the stack usage ("1 + 2*x - 1" is odd) and document what it must do, and why it must adjust the stack.
Fixes: 8508a5e0e9db ("um: Fix misaligned stack in stub_exe") Link: https://lore.kernel.org/linux-um/CABVgOSntH-uoOFMP5HwMXjx_f1osMnVdhgKRKm4uz6DFm2Lb8Q@mail.gmail.com/ Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
show more ...
|
| 91f0a0c5 | 19-Sep-2024 |
Benjamin Berg <benjamin.berg@intel.com> |
um: Calculate stub data address relative to stub code
Instead of using the current stack pointer, we can also use the current instruction to calculate where the stub data is. With this the stub data
um: Calculate stub data address relative to stub code
Instead of using the current stack pointer, we can also use the current instruction to calculate where the stub data is. With this the stub data only needs to be aligned to a full page boundary.
Changing this has the advantage that we do not have a hole in the memory space above the stub data (which would need to be explicitly cleared).
Another motivation to do this is that with the planned addition of a SECCOMP based userspace the stack pointer may not be fully trustworthy.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Link: https://patch.msgid.link/20240919124511.282088-7-benjamin@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
show more ...
|
| 7b84543c | 10-Nov-2023 |
Benjamin Berg <benjamin@sipsolutions.net> |
um: Always inline stub functions
The stub executable page is remapped to a different location in the userland process. As these functions may be used by the stub, they really need to be always inlin
um: Always inline stub functions
The stub executable page is remapped to a different location in the userland process. As these functions may be used by the stub, they really need to be always inlined rather than permitting the compiler to emit a function.
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net> Signed-off-by: Richard Weinberger <richard@nod.at>
show more ...
|