On 2/22/2015 4:32 PM, Benjamin Kaduk wrote:
>
> I suspect that the struct layout randomization code is triggering on the
> RAND_METHOD structure (see, e.g., is_pure_ops_struct() on the linked
> patch), and the use of an ordered initializer is incompatible with the
> layout randomization.  The bulk of the linked patch is converting struct
> initializers to the C99 .member syntax, which is compatible with the
> random layout.  OpenAFS cannot switch to that C99 syntax because it is not
> fully supported on all the platforms OpenAFS attempts to support.  (This
> code is actually code imported from Heimdal, anyway, so Heimdal would need
> to make the change first.)

The primary reason that Heimdal and OpenAFS do not use the C99 .member
syntax is because the Windows compilers required to support Windows XP
through Windows 7/Server 2008 R2 do not implement that portion of C99.
Heimdal supports Windows C/C++ back to 15.00 and OpenAFS supports
Windows C/C++ back to 14.00.

I believe there are also older UNIX platforms that are still supported
that do not have C99 compilers.

Looking at the referenced patch you might want to add

 #if GCC_VERSION >= 40500
 # ifdef RANDSTRUCT_PLUGIN
 # define __randomize_layout __attribute__((randomize_layout))
 # define __no_randomize_layout __attribute__((no_randomize_layout))
 # endif
 #endif

into the build and add the __no_randomize_layout macro to structures
that are failing to build.   If you can construct an appropriate patch
for Heimdal you can submit it as a pullup request via github.com.

Jeffrey Altman


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to