NeoA11y / SpeakTouch

[WIP] A free software screen reader for Android.
9 stars 0 forks source link

Add Memory Tagging Extension (MTE) Support for ARMv9 devices #106

Closed PatrykMis closed 1 year ago

PatrykMis commented 1 year ago

Description

Introduce Memory Tagging Extension (MTE) to enhance application security and detect memory-related issues on supported devices with Android 14+.

This commit implements MTE, a hardware-based memory safety feature, to help identify and prevent memory corruption issues, such as buffer overflows and use-after-free vulnerabilities. ARM memory tagging support provides a limited form of memory safety for both memory unsafe languages (C, C++) and the small subset of unsafe code in memory safe languages (Rust, Java, Kotlin).

MTE leverages hardware-based memory tagging to associate metadata with each memory allocation, enabling runtime detection of out-of-bounds accesses. This proactive approach enhances the robustness of our application, making it more resistant to memory-related security vulnerabilities.

MTE is supported on platforms that provide ARMv8.5-A (and up) architecture (devices such as Pixel 8/8 Pro) with MTE capabilities. This addition ensures our application can take advantage of the latest hardware security features for a more secure and reliable user experience.

More info: https://community.arm.com/arm-community-blogs/b/operating-systems-blog/posts/new-mte-user-guide

Irineu333 commented 1 year ago

I found the commit description excessively long. I don't know what you think, but I'm used to shorter and more to-the-point commits.

PatrykMis commented 1 year ago

Ok, updated. Let the description stay in this pull request, it will be enough I think.

Irineu333 commented 1 year ago

@PatrykMis You tested it on a compatible device, right?

PatrykMis commented 1 year ago

Yes, of course. On my Pixel 8 using GrapheneOS. I would not open PR unless I test first (except draft PRs).

Irineu333 commented 1 year ago

@PatrykMis Good, sorry for the question.