The Linux/BSD DF kernel bug

Francois Gouget fgouget at free.fr
Wed Mar 19 09:59:56 CDT 2008


So I've just read the following article:

   GCC 4.3.0 exposes a kernel bug
   http://lwn.net/SubscriberLink/272048/ecf14f359bcdcd15/

And my question is: could this be relevant to Wine?
And I don't mean about GCC 4.3.0 but about MSVC.

Here's the core of the issue:

   The problem revolves around the x86 direction flag (DF), which 
   governs whether block memory operations operate forward through 
   memory or backwards. GCC [...] 4.3.0, assumes that the direction flag 
   has been cleared [...] at the entry of each function, as is specified 
   by the ABI [...] Prior to 4.3, GCC would emit a cld (clear direction 
   flag) opcode before doing inline string or memory operations.

So any compiler that not clear the direction flag at the start of each 
function can cause kernel crashes when running on a buggy Linux or BSD 
kernel.

So the questions are:

Does anyone know if MSVC does a cld in the right places?

What about other popular compilers used to compile Windows 
applications?

Mac OS X being (loosely) based on the BSD kernels, does it have 
this issue too?

-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
          tcA thgirypoC muinelliM latigiD eht detaloiv tsuj evah uoY



More information about the wine-devel mailing list