Skip to content

Commit 692c20c

Browse files
author
Joachim Kern
committed
8368997: AIX allows reading from address zero which leads to several ubsan findings
Reviewed-by: mdoerr, mbaesken
1 parent 285d16a commit 692c20c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/hotspot/os/posix/safefetch_sigjmp.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ ATTRIBUTE_NO_ASAN static bool _SafeFetchXX_internal(const T *adr, T* result) {
6767

6868
T n = 0;
6969

70+
#ifdef AIX
71+
// AIX allows reading from nullptr without signalling
72+
if (adr == nullptr) {
73+
*result = 0;
74+
return false;
75+
}
76+
#endif
77+
7078
// Set up a jump buffer. Anchor its pointer in TLS. Then read from the unsafe address.
7179
// If that address was invalid, we fault, and in the signal handler we will jump back
7280
// to the jump point.

0 commit comments

Comments
 (0)