#189 SSSD Segfaults when running initgroups on a proxy provider that doesn't supply _nss_XXX_initgroups_dyn
Closed: Fixed Opened by sgallagh.

SSSD Config

[services]
activeServices = nss, dp, pam
[services/nss]
filterGroups = root
filterUsers = root
EntryCacheTimeout = 30
EntryCacheNoWaitRefreshTimeout = 15
[domains]
domains = LEGACYLOCAL
[domains/LEGACYLOCAL]
description = LOCAL migration domain
enumerate = true
minId = 500
provider = files

Start the sssd with {{{ulimit -c unlimited}}} set in the environment

ulimit -c unlimited
sssd -d3

Execute the following command in another shell

id bin

The sssd_be process will dump core. Analyzing the core file gives this backtrace:

Core was generated by `/usr/libexec/sssd/sssd_be -d 99 --domain LEGACYLOCAL'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000000000 in ?? ()
Missing separate debuginfos, use: debuginfo-install sssd-2009080701-0.fc11.x86_64
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007fd53b5514b6 in get_initgr_groups_process (subreq=0x0)
    at ../../server/providers/proxy.c:1548
#2  0x0000000000419091 in sysdb_store_user_attr_done (subreq=0x0)
    at ../../server/db/sysdb_ops.c:2755
#3  0x0000000000413642 in sysdb_set_user_attr_done (subreq=0x0)
    at ../../server/db/sysdb_ops.c:1139
#4  0x0000000000410f31 in sysdb_op_default_done (subreq=0x0)
    at ../../server/db/sysdb_ops.c:234
#5  0x0000000000410c64 in sldb_request_callback (ldbreq=0xfaef30, 
    ldbreply=0xfb8a00) at ../../server/db/sysdb_ops.c:163
#6  0x00007fd541382423 in ldb_module_done (req=0xfaef30, ctrls=0x0, 
    response=0x0, error=0) at common/ldb_modules.c:703
#7  0x00007fd53b759f05 in mbof_orig_mod_callback (req=0xfafa50, ares=0x0)
    at ../../server/ldb_modules/memberof.c:2016
#8  0x00007fd54138ad7f in ltdb_callback (ev=<value optimized out>, 
    te=<value optimized out>, t={tv_sec = 0, tv_usec = 0}, 
    private_data=<value optimized out>) at ldb_tdb/ldb_tdb.c:1120
#9  0x0000003fbe002f25 in tevent_common_loop_timer_delay (ev=0xfa5a50)
    at tevent_timed.c:254
#10 0x0000003fbe00455b in std_event_loop_once (ev=0xfa5a50)
    at tevent_standard.c:543
#11 0x0000003fbe0047e6 in std_event_loop_wait (ev=0xfa5a50)
---Type <return> to continue, or q <return> to quit---
    at tevent_standard.c:567
#12 0x0000000000423cfd in server_loop (main_ctx=0xfa5b70)
    at ../../server/util/server.c:406
#13 0x000000000040a69a in main (argc=5, argv=0x7fff14571508)
    at ../../server/providers/data_provider_be.c:1039

The initgroups_dyn function pointer is NULL.

(gdb) up 1
#1  0x00007fd53b5514b6 in get_initgr_groups_process (subreq=0x0)
    at ../../server/providers/proxy.c:1548
1548        status = ctx->ops.initgroups_dyn(state->name, state->gid, &num_gids,
(gdb) print ctx->ops.initgroups_dyn
$8 = (enum nss_status (*)(const char *, gid_t, long int *, long int *, 
    gid_t **, long int, int *)) 0
(gdb)

Also relevant, from the logs:

[sssd[be[LEGACYLOCAL]]] [sssm_proxy_init] (1): The 'files' library does not provides the _nss_XXX_initgroups_dyn function!
initgroups will be slow as it will require full groups enumeration!

Fields changed

cc: => sejeff

Fields changed

testsupdated: 0 => 1

Fixed in 1f5ab2205792b4fc756d4663c090811ea75f7a46

fixedin: => 0.6.0
resolution: => fixed
status: new => closed

Fields changed

rhbz: => 0

Metadata Update from @sgallagh:
- Issue assigned to simo
- Issue set to the milestone: SSSD 0.6.0

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/1231

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata