summaryrefslogtreecommitdiff
path: root/arch/um/os-Linux/skas
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin@sipsolutions.net>2024-07-03 16:45:26 +0300
committerJohannes Berg <johannes.berg@intel.com>2024-07-03 18:09:48 +0300
commitdc26184a9d4acde988e996a437b0301b81c1ae2d (patch)
treef5cf8f56284356306f06b968d512b3a5153bc9bf /arch/um/os-Linux/skas
parentd1d3a2e69b2419d77f8f99315ac931c5ba3cb475 (diff)
downloadlinux-dc26184a9d4acde988e996a437b0301b81c1ae2d.tar.xz
um: Create signal stack memory assignment in stub_data
When we switch to use seccomp, we need both the signal stack and other data (i.e. syscall information) to co-exist in the stub data. To facilitate this, start by defining separate memory areas for the stack and syscall data. This moves the signal stack onto a new page as the memory area is not sufficient to hold both signal stack and syscall information. Only change the signal stack setup for now, as the syscall code will be reworked later. Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net> Link: https://patch.msgid.link/20240703134536.1161108-3-benjamin@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/os-Linux/skas')
-rw-r--r--arch/um/os-Linux/skas/process.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 45885deb6cae..56403a1b006a 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -474,11 +474,12 @@ static int __init init_thread_regs(void)
thread_regs[REGS_IP_INDEX] = STUB_CODE +
(unsigned long) stub_clone_handler -
(unsigned long) __syscall_stub_start;
- thread_regs[REGS_SP_INDEX] = STUB_DATA + STUB_DATA_PAGES * UM_KERN_PAGE_SIZE -
- sizeof(void *);
-#ifdef __SIGNAL_FRAMESIZE
- thread_regs[REGS_SP_INDEX] -= __SIGNAL_FRAMESIZE;
-#endif
+
+ /* syscall data as a temporary stack area (top half). */
+ thread_regs[REGS_SP_INDEX] = STUB_DATA +
+ offsetof(struct stub_data, syscall_data) +
+ sizeof(((struct stub_data *) 0)->syscall_data) -
+ sizeof(void *);
return 0;
}