# Re: \[PATCH v3 1/4\] arm64/gcs: release GCS on failed fork

- From: Mark Brown \<broonie@kernel.org\>
- Date: 2026-10-28 18:41:20 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2026/10/17820985
- Thread: https://ratatoskr.run/linux-arm-kernel/2026/10/17817987/t.md

```text
On Wed, Oct 28, 2026 at 12:43:12PM -0300, Iván Ezequiel Rodriguez wrote:
> copy_thread() can map a CLONE_VM GCS and still return 0. A later
> copy_process() failure calls exit_thread(), but arm64 did not
> implement it, so the VMA stayed in the parent's mm. Wire
> HAVE_EXIT_THREAD to gcs_free().

One extremely minor nit below, I verified that this fails with the
current kernel and that the kernel change causes it to pass so with or
without dealing with that:

Reviewed-by: Mark Brown <broonie@kernel.org>
Tested-by: Mark Brown <broonie@kernel.org>

> @@ -328,6 +335,7 @@ static int copy_thread_gcs(struct task_struct *p,
>  {
>  	return 0;
>  }
> +static void gcs_reset_thread(struct task_struct *task) { }
>  

This looks like there's a missing blank line but it fits in with the
missing blank before the stub for copy_thread_gcs().  Possibly slightly
neater to put this before there next to the similar flush_gcs() stub but
meh.
```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-arm-kernel/2026/10/17820985/attachment/0) (application/pgp-signature, 488 bytes)
