RFR: 8297967: Make frame::safe_for_sender safer
Thomas Stuefe
stuefe at openjdk.org
Thu Dec 1 19:14:33 UTC 2022
On Thu, 1 Dec 2022 18:32:54 GMT, Johannes Bechberger <duke at openjdk.org> wrote:
>> src/hotspot/cpu/aarch64/frame_aarch64.cpp line 268:
>>
>>> 266: // Will the pc we fetch be non-zero (which we'll find at the oldest frame) and readable
>>> 267:
>>> 268: if (!os::is_readable_pointer(this->fp() + return_addr_offset * sizeof(address))) {
>>
>> Address computation looks wrong: `fp()` returns an `intptr_t*`, so `return_addr_offset` gets scaled automatically before the addition. Wouldn't `thread->is_in_usable_stack(fp())` be a better check?
>
>> Wouldn't thread->is_in_usable_stack(fp()) be a better check?
>
> No, this would check something different.
>
>> Address computation looks wrong
>
> But tests show that it seems to be correct.
I think Martin is right.
-------------
PR: https://git.openjdk.org/jdk/pull/11461
More information about the hotspot-dev
mailing list