RFR: 8369393: NMT: poison the canaries of malloc header under ASAN build [v20]
Afshin Zafari
azafari at openjdk.org
Mon Nov 10 11:34:30 UTC 2025
On Mon, 10 Nov 2025 10:27:48 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>>
>> order of includes corrected.
>
> src/hotspot/share/nmt/mallocHeader.hpp line 126:
>
>> 124: inline static OutTypeParam resolve_checked_impl(InTypeParam memblock);
>> 125:
>> 126: void asan_poison_self() {
>
> Why this complex? Why not just poison/unpoison the whole header in one call? You could simplify quite a bit that way.
The only reason is to avoid unpoisoning when accessing other fields as MemTag or MST_Marker, and poisoning back when access is completed. Now MemTag and mst_marker fields are free to be accessed without unpoisoning first.
I can change the issue title and do the whole header poisoning, if it is preferred.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27685#discussion_r2510115250
More information about the hotspot-runtime-dev
mailing list