Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABob6iqO7fOUDoNtXuxMANgRnO2MMYL26sRonm+LnTsNdvjAZA@mail.gmail.com>
Date: Fri, 12 Oct 2012 03:37:53 +0200
From: Lukas Odzioba <lukas.odzioba@...il.com>
To: john-dev@...ts.openwall.com
Subject: Re: Memory leak in most OpenCL formats

2012/10/8 magnum <john.magnum@...hmail.com>:
> On 8 Oct, 2012, at 20:04 , magnum <john.magnum@...hmail.com> wrote:
>
>> I found a nasty bug today that affects all OpenCL formats that use the shared find_best_workgroup() function. The bug is present in numerous formats in the released Jumbo-6 (I think) and Jumbo-7 (definitely). The fix (in each of those formats) is this:
> ...
>> BTW, maybe there are better ways to handle this than the quick'n'dirty fix I made: I suppose we could change the global profilingEvent into *profilingEvent and do something like this in common-opencl:
>>
>> opencl_find_best_workgroup(args)
>> {
>>       cl_event benchEvent;
>>       profilingEvent = &benchEvent
>>       ...
>>       (do the find_best stuff)
>>       ...
>>       profilingEvent = NULL;
>> }
>>
>> Then it would point to a valid event during find_best() and then set to NULL during actual cracking, with no need to release anything for each crypt_all(). Theoretically this is cleaner but we'd still need to patch all 22 formats, changing &profilingEvent into just profilingEvent.
>
> The last part of the above became clear to me as I wrote that mail :)  And obviously that solutions is much cleaner, and potentially faster (events are never even created when not needed). So I have now committed another patch that reverted the first one and implemented the pointer version instead. Works like a champ.

I totally agree - with this solution you will not forget about setting
it to zero. Thanks for taking care of it - this bug was introduced by
me.

Lukas

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.