Commit f3557900 authored by Mark Brown's avatar Mark Brown Committed by Todd Kjos
Browse files

FROMGIT: arm64/mte: Remove asymmetric mode from the prctl() interface



As pointed out by Evgenii Stepanov one potential issue with the new ABI for
enabling asymmetric is that if there are multiple places where MTE is
configured in a process, some of which were compiled with the old prctl.h
and some of which were compiled with the new prctl.h, there may be problems
keeping track of which MTE modes are requested. For example some code may
disable only sync and async modes leaving asymmetric mode enabled when it
intended to fully disable MTE.

In order to avoid such mishaps remove asymmetric mode from the prctl(),
instead implicitly allowing it if both sync and async modes are requested.
This should not disrupt userspace since a process requesting both may
already see a mix of sync and async modes due to differing defaults between
CPUs or changes in default while the process is running but it does mean
that userspace is unable to explicitly request asymmetric mode without
changing the system default for CPUs.

Reported-by: default avatarEvgenii Stepanov <eugenis@google.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reviewed-by: default avatarEvgenii Stepanov <eugenis@google.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Branislav Rankov <branislav.rankov@arm.com>
Link: https://lore.kernel.org/r/20220309131200.112637-1-broonie@kernel.org


Signed-off-by: default avatarWill Deacon <will@kernel.org>
(cherry picked from commit cf220ad6
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

 for-next/mte)
Bug: 217221156
Change-Id: I1170cb5f345243843fdebbc9d6c54c6443d782ae
Signed-off-by: default avatarEvgenii Stepanov <eugenis@google.com>
parent 0f8a5d6b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment