]> www.infradead.org Git - users/jedix/linux-maple.git/commit
um: Calculate stub data address relative to stub code
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 19 Sep 2024 12:45:07 +0000 (14:45 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 10 Oct 2024 11:37:22 +0000 (13:37 +0200)
commit91f0a0c5cc5bc863888a936fbd05394c6e284466
tree6b42aa2932bf01d303eae08fafc4ce785c74f791
parent77eb31b6003a158cce534fa9ca9df21fc82672ea
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>
arch/um/kernel/um_arch.c
arch/x86/um/shared/sysdep/stub_32.h
arch/x86/um/shared/sysdep/stub_64.h