Today NMT has two canaries: A header and a footer canary. These enable mainly two things:
1. For NMT to aid in identifying and describing a pointer
2. A basic form of out-of-bounds protection
With the introduction of UBSan and Asan into OpenJDK we have gained stronger tools for out-of-bounds analysis, without requiring NMT to be activated. Therefore, I believe that point 2 is no longer something that NMT needs to support. For point 1, we will unfortunately be losing this ability for malloc:ed memory if the canaries are removed, only retaining it for mmaped memory.
I'd like to suggest that we remove these canaries. It would open up valuable real estate in the malloc headers, which we may use for future NMT feature development.
1. For NMT to aid in identifying and describing a pointer
2. A basic form of out-of-bounds protection
With the introduction of UBSan and Asan into OpenJDK we have gained stronger tools for out-of-bounds analysis, without requiring NMT to be activated. Therefore, I believe that point 2 is no longer something that NMT needs to support. For point 1, we will unfortunately be losing this ability for malloc:ed memory if the canaries are removed, only retaining it for mmaped memory.
I'd like to suggest that we remove these canaries. It would open up valuable real estate in the malloc headers, which we may use for future NMT feature development.
- duplicates
-
JDK-8325804 Move canaries out of NMT
-
- Closed
-
- relates to
-
JDK-8345342 Extend NMT, so that it can help catch memory corruptions
-
- Open
-
-
JDK-8318721 Provide os wrapper for posix_memalign
-
- Closed
-
- links to
-
Review(master) openjdk/jdk/21560