<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1206</bug_id>
          
          <creation_ts>2015-08-28 00:39:35 +0200</creation_ts>
          <short_desc>Security: Clear exposed framebuffer after creation and before visibility</short_desc>
          <delta_ts>2015-10-05 08:25:59 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>2.3.2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>649</dependson>
    
    <dependson>1020</dependson>
    
    <dependson>1205</dependson>
          <blocked>145</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>sgothel</cc>
    
    <cc>xerxes</cc>
    
    <cc>xerxes</cc>
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs>fe0be75545adcec2746f7e0ef53af7c75bfc8fc8
5d0c40061b11909253f07b347db0342b1be38c80</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>5023</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-28 00:39:35 +0200</bug_when>
    <thetext>Any created framebuffer exposed to the user (visibility)
or 3rd party tool shall be cleared 
after creation and before exposure.

This shall ensure that no user or any 3rd party utility
will be enabled to read uninitialized memory.
The latter could be content of previous windows
or even any arbitrary memory region, depending of the 
underlying driver.

JOGL shall ensure that all framebuffers
which are intended for visible exposure are cleared.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5028</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-28 01:18:05 +0200</bug_when>
    <thetext>Known exposed FBOs are:
  - GLJPanel
  - Any used OSX CALayer 

Otherwise it might be overkill to clear all FBOs
right at creation - performance wise?!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5343</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-10-04 02:52:44 +0200</bug_when>
    <thetext>It has been observed that on certain setups,
e.g. GNU/Linux + X11 + AMD/Mesa,
the OpenGL framebuffer is uninitialized and exposes
its content even if the NEWT window content has been cleared (Bug 1020).

This can be tested via TestGearsES2NEWT &apos;-demo 0&apos;,
i.e. w/o any active GLEventListener.
(commit fe0be75545adcec2746f7e0ef53af7c75bfc8fc8)

Hence onscreen GLAutoDrawable need to clear the 
default framebuffer right after initialization as well!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5344</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-10-04 02:53:44 +0200</bug_when>
    <thetext>(In reply to Sven Gothel from comment #2)
&gt; It has been observed that on certain setups,
&gt; e.g. GNU/Linux + X11 + AMD/Mesa,
&gt; the OpenGL framebuffer is uninitialized and exposes
&gt; its content even if the NEWT window content has been cleared (Bug 1020).
That is Bug 1205, not Bug 1020!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5349</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-10-05 08:25:59 +0200</bug_when>
    <thetext>commit 5d0c40061b11909253f07b347db0342b1be38c80:
    
Experimenting w/ no GLEventListener attached to an GLAutoDrawable,
e.g. GLWindow (onscreen), GLJPanel (fbo offscreen),
indeed on some GL implementations the default framebuffer is uninitialized
and hence shows garbage.
    
GLDrawableHelper.setViewportAndClear(..)
 - Clear framebuffer after setting viewport
 - Called from:
   - public final void init(..)
   - public final void reshape(..)
    
 - Method is used independent of GLEventListener,
   hence this simplifies implementation: removes &apos;setViewport&apos; criteria
   for init, display, reshape: it is always performed!
    
Note: We only attempt to help against leaking un-initialized framebuffer content
not against user-app faults, we do not clear a 2nd-buffer (double-buffering).
    
Note: We may still be late at resize, i.e. small noisy flickering might be visible.
This might be due to lack of proper vsync.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>