]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: mte: Allow user control of the generated random tags via prctl()
authorCatalin Marinas <catalin.marinas@arm.com>
Tue, 10 Dec 2019 11:19:15 +0000 (11:19 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 4 Sep 2020 11:46:07 +0000 (12:46 +0100)
commit7058b7067f9c80f0061aaf01f51904aaf130794c
treef47b4662e6307e2f9ca8d7d9126760216afadd4b
parenta0b9e1a2c988a195076f66456e15d8060dd57acf
arm64: mte: Allow user control of the generated random tags via prctl()

The IRG, ADDG and SUBG instructions insert a random tag in the resulting
address. Certain tags can be excluded via the GCR_EL1.Exclude bitmap
when, for example, the user wants a certain colour for freed buffers.
Since the GCR_EL1 register is not accessible at EL0, extend the
prctl(PR_SET_TAGGED_ADDR_CTRL) interface to include a 16-bit field in
the first argument for controlling which tags can be generated by the
above instruction (an include rather than exclude mask). Note that by
default all non-zero tags are excluded. This setting is per-thread.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
arch/arm64/include/asm/processor.h
arch/arm64/include/asm/sysreg.h
arch/arm64/kernel/mte.c
arch/arm64/kernel/process.c
include/uapi/linux/prctl.h