-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
15
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
I have readJDK-6535542 comment, and know zero-initialized is for security reason.
I suggest modify code at java.nio.DirectByteBuffer line 129
from:
UNSAFE.setMemory(base, size, (byte) 0);
to
UNSAFE.setMemory(address, cap, (byte) 0);
The different is when DirectMemoryPageAligned is set, address is the start of the page, this would not touch the unused part, and it will also be zero-initialized.
As O_DIRECT is supported from java 11, I think this problem is worth to considered.
I have read
I suggest modify code at java.nio.DirectByteBuffer line 129
from:
UNSAFE.setMemory(base, size, (byte) 0);
to
UNSAFE.setMemory(address, cap, (byte) 0);
The different is when DirectMemoryPageAligned is set, address is the start of the page, this would not touch the unused part, and it will also be zero-initialized.
As O_DIRECT is supported from java 11, I think this problem is worth to considered.
- relates to
-
JDK-6535542 (bf spec) ByteBuffer.allocate{Direct}?() has undocumented zero-initialization
-
- Closed
-