arm64, riscv: release shadow stacks on failed fork
Status from this message: Applied to arm64 (for-next/core), thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest4 patches 5 repliesApplied
- v24 patches 1 replySuperseded
- v14 patches 2 repliesSuperseded
Changes in v3 from the cover letter
- Move gcs_reset_thread() into process.c (Mark Brown).
- Spell out the x86 vs arm64/riscv difference above.
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | arm64/gcs: release GCS on failed forkarch/ arch/ | +17 | 3 replies | |
| 2/4 | riscv/shstk: release shadow stack on failed forkarch/ arch/ | +10 | 0 replies | |
| 3/4 | selftests/arm64: GCS must not leak on a failed clone3tools/ tools/ tools/ +2 more | +194 | 1 reply | |
| 4/4 | selftests/riscv: shadow stack must not leak on a failed clone3tools/ tools/ | +177 | 0 replies |
Reviews trailers per patch
2 of 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Mark Brown |
|---|---|
| Series | R-b |
| 1/4 | R-b T-b |
| 2/4 | |
| 3/4 | R-b T-b |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/4] arm64, riscv: release shadow stacks on failed fork
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().
Changes since v2:
- Move gcs_reset_thread() into process.c (Mark Brown).
- Spell out the x86 vs arm64/riscv difference above.
v2: https://lore.kernel.org/all/[email protected]/
Iván Ezequiel Rodriguez (4):
arm64/gcs: release GCS on failed fork
riscv/shstk: release shadow stack on failed fork selftests/arm64: GCS must not leak on a failed clone3 selftests/riscv: shadow stack must not leak on a failed clone3
arch/arm64/Kconfig | 1 + arch/arm64/kernel/process.c | 16 ++ arch/riscv/Kconfig | 1 + arch/riscv/kernel/process.c | 9 + tools/testing/selftests/arm64/gcs/Makefile | 3 +- .../selftests/arm64/gcs/gcs-clone-pidfd.c | 168 +++++++++++++++++ .../testing/selftests/arm64/gcs/gcs-locking.c | 20 -- tools/testing/selftests/arm64/gcs/gcs-util.h | 24 +++ tools/testing/selftests/arm64/gcs/libc-gcs.c | 20 -- tools/testing/selftests/riscv/cfi/Makefile | 5 +- .../selftests/riscv/cfi/shstk-clone-pidfd.c | 173 ++++++++++++++++++ 11 files changed, 398 insertions(+), 42 deletions(-) create mode 100644 tools/testing/selftests/arm64/gcs/gcs-clone-pidfd.c create mode 100644 tools/testing/selftests/riscv/cfi/shstk-clone-pidfd.c
Signature · 1 line
2.43.0