#5928 topology plugins sigsev when adding a managed host
Closed: Fixed None Opened 7 years ago by tbordaz.

Freeipa 4.3.90 - DS 1.3.4.9-1

When adding a managed host, topology plugin checks that the host is not already present.
For some reason the configuration for the suffix contains a host with hostname=NULL --> crash

(gdb) where
#0  0x00007fa8872fa5a1 in __strcasecmp_l_avx () from /lib64/libc.so.6
#1  0x00007fa87dd29a5c in ipa_topo_cfg_host_find (tconf=tconf@entry=0x7fa858015030, 
    findhost=findhost@entry=0x7fa8584b7860 "configured-ca.ipa.test", lock=lock@entry=0) at topology_cfg.c:455
#2  0x00007fa87dd29afc in ipa_topo_cfg_host_add (replica=0x7fa858015030, newhost=0x7fa8584b7860 "configured-ca.ipa.test")
    at topology_cfg.c:480
#3  0x00007fa87dd2ecc6 in ipa_topo_util_add_managed_host (suffix=<optimized out>, addhost=0x7fa8584b7860 "configured-ca.ipa.test")
    at topology_util.c:1482
#4  0x00007fa8584bb2c0 in ?? ()
#5  0x00007fa8584bb2b0 in ?? ()
#6  0x00007fa87dd2ed59 in ipa_topo_util_add_host (hostentry=<optimized out>) at topology_util.c:1498
#7  0x00007fa87dd2a742 in ipa_topo_post_add (pb=<optimized out>) at topology_post.c:106
#8  0x00007fa889a199a9 in plugin_call_func (list=0x564394aa5cf0, operation=operation@entry=507, pb=pb@entry=0x7fa864ff8b00, 
    call_one=call_one@entry=0) at ldap/servers/slapd/plugin.c:1987
#9  0x00007fa889a19c35 in plugin_call_list (pb=0x7fa864ff8b00, operation=507, list=<optimized out>)
    at ldap/servers/slapd/plugin.c:1931
#10 plugin_call_plugins (pb=pb@entry=0x7fa864ff8b00, whichfunction=whichfunction@entry=507) at ldap/servers/slapd/plugin.c:438
#11 0x00007fa8899bfed8 in op_shared_add (pb=pb@entry=0x7fa864ff8b00) at ldap/servers/slapd/add.c:764
#12 0x00007fa8899c1178 in do_add (pb=pb@entry=0x7fa864ff8b00) at ldap/servers/slapd/add.c:226
#13 0x00005643929c5458 in connection_dispatch_operation (pb=0x7fa864ff8b00, op=0x5643950ac080, conn=0x7fa874344878)
    at ldap/servers/slapd/connection.c:604
#14 connection_threadmain () at ldap/servers/slapd/connection.c:1751
#15 0x00007fa887be065b in _pt_root (arg=0x56439504d300) at ../../../nspr/pr/src/pthreads/ptthread.c:216
#16 0x00007fa88757d60a in start_thread () from /lib64/libpthread.so.0
#17 0x00007fa8872b7bbd in ntp_adjtime () from /lib64/libc.so.6
#18 0x0000000000000000 in ?? ()



(gdb) down
#2  0x00007fa87dd29afc in ipa_topo_cfg_host_add (replica=0x7fa858015030, newhost=0x7fa8584b7860 "configured-ca.ipa.test")
    at topology_cfg.c:480
(gdb) print *replica
$1 = {next = 0x7fa85822e7d0, repl_lock = 0x7fa8580089a0, 
  shared_config_base = 0x7fa858003b30 "cn=ca,cn=topology,cn=ipa,cn=etc,dc=ipa,dc=test", repl_root = 0x7fa858436140 "o=ipaca", 
  strip_attrs = 0x0, total_attrs = 0x0, repl_attrs = 0x0, repl_segments = 0x0, hosts = 0x7fa87000ed30}
(gdb) print newhost
$2 = 0x7fa8584b7860 "configured-ca.ipa.test"


(gdb) down
#1  0x00007fa87dd29a5c in ipa_topo_cfg_host_find (tconf=tconf@entry=0x7fa858015030, 
    findhost=findhost@entry=0x7fa8584b7860 "configured-ca.ipa.test", lock=lock@entry=0) at topology_cfg.c:455
455         if (!strcasecmp(host->hostname,findhost)) {

(gdb) print *host
$4 = {next = 0x0, hostname = 0x0}
(gdb) print findhost
$5 = 0x7fa8584b7860 "configured-ca.ipa.test"


It crashes:
454     for (host=tconf->hosts;host;host=host->next) {
455         if (!strcasecmp(host->hostname,findhost)) {
456            break;
457         }
458     }

is there a testcase to reproduec this ?

master:

  • 0b11b36 v2 - avoid crash in topology plugin when host list contains host with no hostname

Metadata Update from @tbordaz:
- Issue assigned to lkrispen
- Issue set to the milestone: FreeIPA 4.4

7 years ago

Login to comment on this ticket.

Metadata