Instead of setting a cache entry back to read-write based on whether MTE is enabled, add a flag that indicates if this entry was made inaccessible. On Android, we have seen strange crashes were MTE is disabled for a process, but the cache entry is inaccessible, causing an access error. This indicates MTE was enabled at some point, then disabled again. There is likely some race, or method to disable without making inaccessible entries read-writable again. Adding the flags should avoid this happening in the future. Remove the resetting of the secondary cache entries when disabling MTE since it can be done as necessary. This change will also allow us to always make the secondary cache entries inaccessible in the future to increase security measures even when MTE is not enabled. Current unit tests already cover this change.
Compiler-RT ================================ This directory and its subdirectories contain source code for the compiler support routines. Compiler-RT is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt. ================================