[SSSD] [PATCH 1/3] Revert "Avoid accessing half-deallocated memory when using talloc_zfree macro."

Dmitri Pal dpal at redhat.com
Wed Nov 14 18:35:21 UTC 2012


On 11/14/2012 11:06 AM, Jakub Hrozek wrote:
> On Wed, Nov 14, 2012 at 05:01:34PM +0100, Pavel Březina wrote:
>> On 11/14/2012 03:01 PM, Simo Sorce wrote:
>>> This reverts commit ff57c6aeb80a52b1f52bd1dac9308a69dc7a4774.
>>>
>>> This commit doesn't really make sense, we are never accessing freed
>>> memory as all we are dealing with is a pointer which is never itsef
>>> part of the memory we are freeing (if it were, it would be an error
>>> in the caller and we shouldn't mask it in this macro).
>>> ---
>>>  src/util/util.h |    6 +-----
>>>  1 files changed, 1 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/src/util/util.h b/src/util/util.h
>>> index b6ecfc2c952bd6a37f49194d961b3f762c9546e7..66bae505df2779dbfc065a09162fd789fef9e835 100644
>>> --- a/src/util/util.h
>>> +++ b/src/util/util.h
>>> @@ -228,11 +228,7 @@ errno_t set_debug_file_from_fd(const int fd);
>>>  #define FLAGS_PID_FILE 0x0004
>>>
>>>  #ifndef talloc_zfree
>>> -#define talloc_zfree(ptr) do { \
>>> -        TALLOC_CTX *_tmp_ctx = ptr; \
>>> -        ptr = NULL; \
>>> -        talloc_free(_tmp_ctx); \
>>> -    } while(0)
>>> +#define talloc_zfree(ptr) do { talloc_free(ptr); ptr = NULL; } while(0)
>>>  #endif
>>>
>>>  #ifndef discard_const_p
>> Hi, we can use TALLOC_FREE(ctx) here, which comes from talloc.h and
>> is identical to this macro.
> Is it present even in very old talloc versions? We still support RHEL5..
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel
Why this is a concern?
We do not plan to support any of the latest versions on RHEL5. It is
less and less needed as we move forward.
I think it would be safe to say that 1.9 was the last version we build
for RHEL5.

-- 
Thank you,
Dmitri Pal

Sr. Engineering Manager for IdM portfolio
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/






More information about the sssd-devel mailing list