RFR: 8297967: Make frame::safe_for_sender safer [v2]

Fei Yang fyang at openjdk.org
Fri Dec 2 05:41:38 UTC 2022


On Thu, 1 Dec 2022 19:21:54 GMT, Johannes Bechberger <duke at openjdk.org> wrote:

>> Makes frame::safe_for_sender safer by using os::is_readable_pointer to check the location of the return address.
>
> Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Imrove fix, thanks Martin

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 (!thread->is_in_usable_stack((address)this->fp())) {

Is this check really necessary? 'fp_safe' is true when we come here. Then it looks to me that the two preceding checks has already ensured that condition 'thread->is_in_usable_stack((address)this->fp())' will always evaluate to true here.

[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/frame_aarch64.cpp#L68
[2] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/frame_aarch64.cpp#L90

-------------

PR: https://git.openjdk.org/jdk/pull/11461


More information about the hotspot-dev mailing list