diff options
author | Johannes Berg <johannes.berg@intel.com> | 2021-01-13 22:09:43 +0100 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2021-02-12 21:35:02 +0100 |
commit | 9f0b4807a44ff81cf59421c8a86641efec586610 (patch) | |
tree | 2fa591a8256cc5a56423323f40b0c87edf9199de /arch/um/os-Linux/skas/mem.c | |
parent | um: separate child and parent errors in clone stub (diff) | |
download | linux-9f0b4807a44ff81cf59421c8a86641efec586610.tar.xz linux-9f0b4807a44ff81cf59421c8a86641efec586610.zip |
um: rework userspace stubs to not hard-code stub location
The userspace stacks mostly have a stack (and in the case of the
syscall stub we can just set their stack pointer) that points to
the location of the stub data page already.
Rework the stubs to use the stack pointer to derive the start of
the data page, rather than requiring it to be hard-coded.
In the clone stub, also integrate the int3 into the stack remap,
since we really must not use the stack while we remap it.
This prepares for putting the stub at a variable location that's
not part of the normal address space of the userspace processes
running inside the UML machine.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/os-Linux/skas/mem.c')
-rw-r--r-- | arch/um/os-Linux/skas/mem.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c index c546d16f8dfe..3b4975ee67e2 100644 --- a/arch/um/os-Linux/skas/mem.c +++ b/arch/um/os-Linux/skas/mem.c @@ -40,6 +40,8 @@ static int __init init_syscall_regs(void) syscall_regs[REGS_IP_INDEX] = STUB_CODE + ((unsigned long) batch_syscall_stub - (unsigned long) __syscall_stub_start); + syscall_regs[REGS_SP_INDEX] = STUB_DATA; + return 0; } |