Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 17 Aug 2015 16:30:57 -0500
From: JimF <jfoug@....net>
To: john-dev@...ts.openwall.com
Subject: Re: FMT_OMP_BAD

On Mon, 17 Aug 2015 16:20:06 -0500, magnum <john.magnum@...hmail.com>  
wrote:

> On 2015-08-17 18:01, Solar Designer wrote:
>> For example, rawMD5_fmt_plug.c has:
>>
>> #include "formats.h"
>>
>> #if !FAST_FORMATS_OMP
>> #undef _OPENMP
>> #endif
>>
>> [...]
>>
>> #ifdef _OPENMP
>>                  FMT_OMP | FMT_OMP_BAD |
>> #endif
>
> This sounds risky to me, it might end up (now or in future) in headers  
> reading incorrectly due to being read as if all of Jumbo is non-OpenMP  
> while it's not.
>
> I think we should keep it as above, and *after* all and any common  
> headers are sourced.

Are you sure after, and not before ALL headers.  now with all the
*common.[ch] that we are creating, it may cause some of them to
improperly compute things like max_passwords.

If we put the

#if !FAST_FORMATS_OMP
#undef _OPENMP
#endif

at the very top of the C files, even before any includes, then the
entire compile of this module will be done under the assumption that
there is no OMP.  I find this safer than having this #undef happening
after all the header includes.

It also removes the requirement for the #ifdef _OPENMP wrapper down
in the format structure.  FMT_OMP and FMT_OMP_BAD will always be
set with a 0 for the build, since there will be no _OPENMP set when
the format.h is included.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.