#1934 sssd crashes if junk is present in sssd.conf
Closed: Fixed None Opened 6 years ago by kaushikub.

  • sssd version used is sssd-1.10.0-6.fc20.beta1
  • Edit sssd.conf and add the word "junk" at the start of the file (I hit this issue due a mistake in the automation script which placed junk characters in sssd.conf).
  • Restart sssd
  • sssd crashes with the below backtrace.

    Core was generated by `/usr/sbin/sssd -D -f'.
    Program terminated with signal 11, Segmentation fault.

    0 __GI___libc_free (mem=0x29) at malloc.c:2896

    2896 if (chunk_is_mmapped(p)) / release mmapped memory. /

    Thread 1 (Thread 0xb6ea16c0 (LWP 9632)):

    0 __GI___libc_free (mem=0x29) at malloc.c:2896

        ar_ptr = <optimized out>
        p = <optimized out>
        hook = 0x0
    

    1 0xb759254f in col_delete_item_with_cb () from /lib/libcollection.so.2

    No symbol table info available.

    2 0xb75925c6 in col_delete_collection () from /lib/libcollection.so.2

    No symbol table info available.

    3 0xb7592fcc in col_destroy_collection () from /lib/libcollection.so.2

    No symbol table info available.

    4 0xb75a80af in ini_config_destroy (ini_config=0xb7ffb2e0) at ini/ini_configobj.c:110

    No locals.

    5 0xb770e018 in sss_ini_config_destroy (init_data=init_data@entry=0xb7ffbcd8) at src/util/sss_ini.c:324

    No locals.

    6 0xb77cb789 in confdb_init_db (config_file=config_file@entry=0xb7ff81d8 "/etc/sssd/sssd.conf", cdb=0xb7ff82f0) at src/confdb/confdb_setup.c:313

        tmp_ctx = 0xb7ffbca0
        ret = 5
        sret = <optimized out>
        version = <optimized out>
        timestr = "1368783035\000\000\000\240\201\377\267\000\000\000"
        lasttimestr = 0x0
        in_transaction = <optimized out>
        config_ldif = 0x0
        vals = {0xbf94d9c7 "1368783035", 0x0}
        ldif = <optimized out>
        init_data = 0xb7ffbcd8
        __FUNCTION__ = "confdb_init_db"
    

    7 0xb77b7e24 in load_configuration (monitor=<synthetic pointer="">, config_file=0xb7ff81d8 "/etc/sssd/sssd.conf", mem_ctx=0xb7ff81a0) at src/monitor/monitor.c:1613

        ret = <optimized out>
        ctx = 0xb7ff8220
        cdb_file = 0x0
    

    8 main (argc=3, argv=0xbf94dc34) at src/monitor/monitor.c:2766

        opt = <optimized out>
        pc = <optimized out>
        opt_daemon = 1
        opt_interactive = 0
        opt_version = 0
        opt_config_file = 0x0
        config_file = 0xb7ff81d8 "/etc/sssd/sssd.conf"
        flags = 5
        main_ctx = 0x1
        tmp_ctx = 0xb7ff81a0
        monitor = <optimized out>
        ret = <optimized out>
        uid = <optimized out>
        long_options = {{longName = 0x0, shortName = 0 '\000', argInfo = 4, arg = 0xb7698120 <poptHelpOptions>, val = 0, descrip = 0xb77ce655 "Help options:", argDescrip = 0x0}, {longName = 0xb77ce663 "debug-level", shortName = 100 'd', argInfo = 2, arg = 0xb7193094 <debug_level>, val = 0, descrip = 0xb77ce66f "Debug level", argDescrip = 0x0}, {longName = 0xb77cddf6 "debug-to-files", shortName = 102 'f', argInfo = 0, arg = 0xb7193090 <debug_to_file>, val = 0, descrip = 0xb77cf680 "Send the debug output to files instead of stderr", argDescrip = 0x0}, {longName = 0xb77ce67b "debug-timestamps", shortName = 0 '\000', argInfo = 2, arg = 0xb719307c <debug_timestamps>, val = 0, descrip = 0xb77ce68c "Add debug timestamps", argDescrip = 0x0}, {longName = 0xb77ce6a1 "debug-microseconds", shortName = 0 '\000', argInfo = 2, arg = 0xb7193078 <debug_microseconds>, val = 0, descrip = 0xb77cf6b4 "Show timestamps with microseconds", argDescrip = 0x0}, {longName = 0xb77ce6b4 "daemon", shortNa!
    

    me = 68 'D', argInfo = 0, arg = 0xbf94da38, val = 0, descrip = 0xb77ce6bb "Become a daemon (default)", argDescrip = 0x0}, {longName = 0xb77ce6d5 "interactive", shortName = 105 'i', argInfo = 0, arg = 0xbf94da3c, val = 0, descrip = 0xb77cf6d8 "Run interactive (not a daemon)", argDescrip = 0x0}, {longName = 0xb77d0667 "config", shortName = 99 'c', argInfo = 1, arg = 0xbf94da44, val = 0, descrip = 0xb77cf6f8 "Specify a non-default config file", argDescrip = 0x0}, {longName = 0xb77d0659 "version", shortName = 0 '\000', argInfo = 0, arg = 0xbf94da40, val = 0, descrip = 0xb77ce6e1 "Print version number and exit", argDescrip = 0x0}, {longName = 0x0, shortName = 0 '\000', argInfo = 0, arg = 0x0, val = 0, descrip = 0x0, argDescrip = 0x0}}
    FUNCTION = "main"


I suspect inserting {{{ init_data->sssd_config = NULL; }}} into sss_ini.c would solve the issue

           ini_config_get_errors(init_data->sssd_config,
                                  &init_data->error_list);
            sss_ini_config_print_errors(init_data->error_list);
            ini_config_free_errors(init_data->error_list);
        }
        ini_config_destroy(init_data->sssd_config);
        init_data->sssd_config = NULL; <================
        return ret;
    }

line 243-244

Ondra, you know the code, can you please take a look?

owner: somebody => okos

Dmitri is right, setting the NULL fixes the issue. I'll go through the code to see if I can spot something similar and send a patch.

status: new => assigned

Fields changed

patch: 0 => 1

Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.10 beta

resolution: => fixed
status: assigned => closed

Metadata Update from @kaushikub:
- Issue assigned to okos
- Issue set to the milestone: SSSD 1.10 beta

2 years ago

Login to comment on this ticket.

Metadata