home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.linux.misc      Linux-specific topics not covered by oth      135,536 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 135,328 of 135,536   
   Richard Kettlewell to Marc Haber   
   Re: For those arguing over languages...   
   10 Feb 26 16:19:01   
   
   From: invalid@invalid.invalid   
      
   Marc Haber  writes:   
   > Does GCC have pragmas so that the programmer can turn off optimization   
   > for only those code parts? That would probably be the wise thing to do   
   > (at least that's what occurs to me, who happens to have zero   
   > experience with serious C programming of time- oder security-critical   
   > code).   
      
   No.   
      
   https://gcc.gnu.org/onlinedocs/cpp/Pragmas.html   
      
   > Turning off optimization completely doesn't sound like the right   
   > thing.   
      
   It’s not the right thing for the simple and obvious reason that it   
   doesn’t solve the problem.   
      
   https://godbolt.org/z/ePPbca91P is the example from Meusel’s slides,   
   translated to C[1] and compiled with -O2. The early exit can be seen at   
   L13 in the asm.   
      
   https://godbolt.org/z/YvYn34dn7 is the same source compiled at -O0.  It   
   no longer has an early exit, but instead, once match=false, every   
   iteration of the loop branches past the update to match (L17). The side   
   channel remains, just in a slightly different form. As a free gift to   
   the attacker the side channel is also amplified by the poor performance,   
   i.e. they don’t need such an accurate clock to extract any signal from   
   it.   
      
      
   [1] I translated to C because the unoptimized object code from the C++   
       example in the slides has a huge amount of irrelevant noise in it   
       due to the all the extra abstraction used in the C++ version.   
      
   --   
   https://www.greenend.org.uk/rjk/   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca