[PATCH 1/7] arm64/gcs: task_gcs_el0_enable() should use passed task
Mark Brown
broonie at kernel.org
Wed Mar 19 08:03:06 PDT 2025
On Wed, Mar 19, 2025 at 02:26:26PM +0000, Mark Rutland wrote:
> On Tue, Mar 18, 2025 at 03:48:35PM -0500, Jeremy Linton wrote:
> if (!task_gcs_el0_enabled(p))
> return 0;
> p->thread.gcs_el0_mode = current->thread.gcs_el0_mode;
> Either that later assignment is redundant, or copy_thread_gcs() was
> accidentally relying upon task_gcs_el0_enabled() reading from 'current'
> rather than 'p', and this change opens up another bug...
copy_thread_gcs() looks buggy here - we should move the allocation of
the new stack to the bottom of the function after the assignments. Like
you say it does currently work due to the check of the source thread.
The other users are the prctl and signal code which always work with
current and the check to see if we should do a GCSB DSYNC in
gcs_thread_switch() which currently misses a sync if switching from a
non-GCS to GCS task.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20250319/25ea82b1/attachment.sig>
More information about the linux-arm-kernel
mailing list