[PATCH v12 23/39] arm64/mm: Implement map_shadow_stack()
Yury Khrustalev
yury.khrustalev at arm.com
Tue Sep 3 02:05:05 PDT 2024
On Thu, Aug 29, 2024 at 12:27:39AM +0100, Mark Brown wrote:
> As discussed extensively in the changelog for the addition of this
> syscall on x86 ("x86/shstk: Introduce map_shadow_stack syscall") the
> existing mmap() and madvise() syscalls do not map entirely well onto the
> security requirements for guarded control stacks since they lead to
> windows where memory is allocated but not yet protected or stacks which
> are not properly and safely initialised. Instead a new syscall
> map_shadow_stack() has been defined which allocates and initialises a
> shadow stack page.
>
> Implement this for arm64. Two flags are provided, allowing applications
> to request that the stack be initialised with a valid cap token at the
> top of the stack and optionally also an end of stack marker above that.
> We support requesting an end of stack marker alone but since this is a
> NULL pointer it is indistinguishable from not initialising anything by
> itself.
>
> Reviewed-by: Thiago Jung Bauermann <thiago.bauermann at linaro.org>
> Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>
> Signed-off-by: Mark Brown <broonie at kernel.org>
Acked-by: Yury Khrustalev <yury.khrustalev at arm.com>
More information about the linux-riscv
mailing list