[Freeipa-devel] [PATCH 0257] Fix race condition during zone loading

Petr Spacek pspacek at redhat.com
Mon Nov 3 12:46:14 UTC 2014


On 17.6.2014 09:33, Tomas Hozza wrote:
> ----- Original Message -----
>> >On 28.5.2014 13:26, Tomas Hozza wrote:
>>> > >On 05/27/2014 03:59 PM, Petr Spacek wrote:
>>>> > >>On 27.5.2014 15:54, Petr Spacek wrote:
>>>>> > >>>Fix race condition during zone loading.
>>>>> > >>>
>>>>> > >>>DNS zone has to be added to DNS view before dns_zone_load() is called.
>>>>> > >>>It is necessary to prevent dns_zone_load() from racing with
>>>>> > >>>dns_zone_setview().
>>>>> > >>>
>>>>> > >>>This race condition sometimes prevents zone from being signed.
>>>>> > >>>Now the unsigned zone is visible until signing process is complete. This
>>>>> > >>>mimics BIND behavior for in-line signed zones.
>>>>> > >>>
>>>>> > >>>https://fedorahosted.org/bind-dyndb-ldap/ticket/56
>>>> > >>
>>>> > >>And here is the patch...
>>>> > >>
>>> > >
>>> > >Hi.
>>> > >
>>> > >When I use bind-dyndb-ldap plugin with this patch, named
>>> > >does not start due to:
>>> > >
>>> > >rbt.c:1379: REQUIRE(name->buffer != ((void *)0)) failed, back trace
>>> > >
>>> > >(gdb) bt
>>> > >#0  0x00007f3963924c39 in raise () from /lib64/libc.so.6
>>> > >#1  0x00007f3963926348 in abort () from /lib64/libc.so.6
>>> > >#2  0x00007f3966979aee in assertion_failed ()
>>> > >#3  0x00007f3964b6917a in isc_assertion_failed () from /lib64/libisc.so.95
>>> > >#4  0x00007f39661ca9da in dns_rbt_fullnamefromnode () from
>>> > >/lib64/libdns.so.100
>>> > >#5  0x00007f396011824b in rbt_iter_getnodename (iter=<optimized out>,
>>> > >nodename=nodename at entry=0x7f39625f8bf0) at rbt_helper.c:46
>>> > >#6  0x00007f396011839b in rbt_iter_next
>>> > >(iterp=iterp at entry=0x7f39625f8b90,
>>> > >nodename=nodename at entry=0x7f39625f8bf0) at rbt_helper.c:144
>>> > >#7  0x00007f3960112d32 in activate_zones
>>> > >(task=task at entry=0x7f39668f5790, inst=0x7f39668e4160) at ldap_helper.c:1164
>>> > >#8  0x00007f396011a20d in barrier_decrement (task=0x7f39668f5790,
>>> > >event=0x7f396005b010) at syncrepl.c:138
>>> > >#9  0x00007f3964b8b836 in run () from /lib64/libisc.so.95
>>> > >#10 0x00007f396473ff33 in start_thread () from /lib64/libpthread.so.0
>>> > >#11 0x00007f39639e3ded in clone () from /lib64/libc.so.6
>>> > >
>>> > >
>>> > >It looks like you should use INIT_BUFFERED_NAME(name); used in the
>>> > >original code instead of dns_name_init(&name, NULL). The macro
>>> > >initializes the buffer in "name", which is missing in the new code.
>> >
>> >Oh yes, it didn't happened on my machine because I have had only single zone
>> >defined in LDAP at the time of testing. Thank you for catching this!
>> >
>> >I'm attaching fixed patch. dns_name_reset() is good enough in this case.
>> >
>> >--
>> >Petr^2  Spacek
>> >
> Now it works.
>
> ACK

This is delayed push notice:
129e54db4fb9ccbb85f2445db81d9f0c89722887

-- 
Petr^2 Spacek




More information about the Freeipa-devel mailing list