Integrated: 8368997: AIX allows reading from address zero which leads to several ubsan findings
Joachim Kern
jkern at openjdk.org
Thu Oct 9 09:48:34 UTC 2025
On Wed, 1 Oct 2025 14:08:08 GMT, Joachim Kern <jkern at openjdk.org> wrote:
> In _SafeFetchXX_internal() a pointer is checked for readability before using. It returns false if this is not the case. The implementation tries to read from the pointer if this is not feasible the signal handler comes into place jumping back to the function via longjmp, so the _SafeFetchXX_internal() itself can return with a false and a null as pseudo content of the address. If the address was readable the function returns true and provides the content of the address.
> Because AIX allows reading from address zero, _SafeFetchXX_internal() returns true and follow up functions using the address are called. All these functions end up in an UBSAN finding regarding reading from zero.
> The solution could be to manually code that also AIX behaves like other operating systems and returns false and the content zero in case of address zero. Then no UBSAN finding occur.
This pull request has now been integrated.
Changeset: 692c20ce
Author: Joachim Kern <jkern at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/692c20ce1df1526bd175572a61d3355a57d42d02
Stats: 8 lines in 1 file changed: 8 ins; 0 del; 0 mod
8368997: AIX allows reading from address zero which leads to several ubsan findings
Reviewed-by: mdoerr, mbaesken
-------------
PR: https://git.openjdk.org/jdk/pull/27591
More information about the hotspot-runtime-dev
mailing list