JDK-8342504 : Remove NMT header and footer canaries
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2024-10-17
  • Updated: 2025-03-18
  • Resolved: 2025-03-18
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
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.
Comments
I'm closing this as canaries are too important, we'll find a different way of solving this problem.
18-03-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21560 Date: 2024-10-17 10:04:16 +0000
17-10-2024