Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8259531

(bf) Modify the DirectByteBuffer zero-initialized code

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      I have read JDK-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.




            bpb Brian Burkhalter
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: