(subset) [PATCH v3 0/4] arm64, riscv: release shadow stacks on failed fork
Catalin Marinas
catalin.marinas at arm.com
Thu Oct 29 13:57:00 PDT 2026
On Wed, 28 Oct 2026 12:43:11 -0300, Iván Ezequiel Rodriguez wrote:
> clone3(CLONE_VM|CLONE_PIDFD) can fail in put_user() after copy_thread()
> has mapped a shadow stack into the shared mm. copy_process() then calls
> exit_thread(). arm64 and riscv did not implement it, so the VMA leaked.
>
> x86 already frees via exit_thread() -> shstk_free(). Its separate TLS
> leak is when copy_thread() fails after the alloc and skips exit_thread().
>
> [...]
Applied to arm64 (for-next/core), thanks!
Only the arm64 changes, riscv can go through the riscv tree. I changed
the commit log a bit on the first patch and addressed some nits Mark
raised. As a separate patch, it might be good to add a kselftest for the
io_uring worker thread and GCS.
[1/4] arm64/gcs: release GCS on failed fork
https://git.kernel.org/arm64/c/078e122f3bf0
[3/4] selftests/arm64: GCS must not leak on a failed clone3
https://git.kernel.org/arm64/c/f46be4da2cbb
More information about the linux-arm-kernel
mailing list