diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2020-12-21 15:03:03 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@arm.com> | 2020-12-21 15:25:25 +0000 |
commit | 26450d04d38c8ed7ce5f2c89114b18c5508f13f1 (patch) | |
tree | bc0d87f44a06d734a62be33261a0b51a55168648 | |
parent | 3378408987189772eec7bc62fc9923a6f01dc63c (diff) | |
download | glibc-26450d04d38c8ed7ce5f2c89114b18c5508f13f1.zip glibc-26450d04d38c8ed7ce5f2c89114b18c5508f13f1.tar.gz glibc-26450d04d38c8ed7ce5f2c89114b18c5508f13f1.tar.bz2 |
elf: Add a tunable to control use of tagged memory
Add a new glibc tunable: mem.tagging. This is a decimal constant in
the range 0-255 but used as a bit-field.
Bit 0 enables use of tagged memory in the malloc family of functions.
Bit 1 enables precise faulting of tag failure on platforms where this
can be controlled.
Other bits are currently unused, but if set will cause memory tag
checking for the current process to be enabled in the kernel.
-rw-r--r-- | elf/dl-tunables.list | 9 | ||||
-rw-r--r-- | manual/tunables.texi | 35 |
2 files changed, 44 insertions, 0 deletions
diff --git a/elf/dl-tunables.list b/elf/dl-tunables.list index e1d8225..4c44ead 100644 --- a/elf/dl-tunables.list +++ b/elf/dl-tunables.list @@ -141,4 +141,13 @@ glibc { default: 512 } } + + mem { + tagging { + type: INT_32 + minval: 0 + maxval: 255 + security_level: SXID_IGNORE + } + } } diff --git a/manual/tunables.texi b/manual/tunables.texi index d72d7a5..1bbdc88 100644 --- a/manual/tunables.texi +++ b/manual/tunables.texi @@ -36,6 +36,8 @@ their own namespace. * POSIX Thread Tunables:: Tunables in the POSIX thread subsystem * Hardware Capability Tunables:: Tunables that modify the hardware capabilities seen by @theglibc{} +* Memory Related Tunables:: Tunables that control the use of memory by + @theglibc{}. @end menu @node Tunable names @@ -484,3 +486,36 @@ instead. This tunable is specific to i386 and x86-64. @end deftp + +@node Memory Related Tunables +@section Memory Related Tunables +@cindex memory related tunables + +@deftp {Tunable namespace} glibc.mem +This tunable namespace supports operations that affect the way @theglibc{} +and the process manage memory. +@end deftp + +@deftp Tunable glibc.mem.tagging +If the hardware supports memory tagging, this tunable can be used to +control the way @theglibc{} uses this feature. At present this is only +supported on AArch64 systems with the MTE extention; it is ignored for +all other systems. + +This tunable takes a value between 0 and 255 and acts as a bitmask +that enables various capabilities. + +Bit 0 (the least significant bit) causes the malloc subsystem to allocate +tagged memory, with each allocation being assigned a random tag. + +Bit 1 enables precise faulting mode for tag violations on systems that +support deferred tag violation reporting. This may cause programs +to run more slowly. + +Other bits are currently reserved. + +@Theglibc{} startup code will automatically enable memory tagging +support in the kernel if this tunable has any non-zero value. + +The default value is @samp{0}, which disables all memory tagging. +@end deftp |