Bug 987536

Summary: sssd_be segfaults on sudo usage
Product: Red Hat Enterprise Linux 6 Reporter: mleary
Component: sssdAssignee: Jakub Hrozek <jhrozek>
Status: CLOSED DUPLICATE QA Contact: Kaushik Banerjee <kbanerje>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4CC: grajaiya, jgalipea, lslebodn, mleary, okos, pbrezina
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-08 08:18:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mleary 2013-07-23 15:30:27 UTC
Description of problem:

SSSD is configured with ldap/kerberos.  Functions normally, except running the sudo command causes sssd_be to crash.  Most of the time the processes is automatically relaunched and sssd recovers.  Occasionally however, sssd does not recover and needs to be manually restarted before users can login again.  Sudo is actually successful despite the crash.

Version-Release number of selected component (if applicable):

1.9.2-82.7.el6_4.x86_64

How reproducible:

Apparently something specific to our sssd configuration causes this, but I am not sure what.  We are authenticating against an AD domain using ldap for directory services and krb5 for the actual auth.  We do not have this issue with nslcd/pam.

coredump has potentially sensitive information, so I'll send it privately but do not want to attach here.

Comment 1 Jakub Hrozek 2013-07-23 15:37:00 UTC
Thank you very much for the bug report. We are not currently aware of any sssd_be crash related to sudo. Feel free to send the corefile to my address (jhrozek) and copy Pavel Brezina (pbrezina).

Comment 2 Jakub Hrozek 2013-07-23 15:41:08 UTC
Also would you mind attaching the logs when you send the core file? To generate the logs, put "debug_level=10" into the [sudo] and [domain] sections of the sssd.conf, restart the sssd, re-run the crasher case and then attach the contents of /var/log/sssd/

Thank you!

Comment 4 Pavel Březina 2013-07-24 11:08:23 UTC
Hi,
thank you for the corefile. Unfortunately, it is not clear why SSSD gets to the state where it crashes.

Can you also send us the logs and possibly sssd.conf please?
Is this always reproducible or does this happen only sporadically?

Comment 5 Jakub Hrozek 2013-08-01 10:05:06 UTC
Hi, any luck getting the log files Pavel requested? Since you were able to reproduce the problem in-house, the log files would be a great help for us..

Comment 6 mleary 2013-08-01 14:59:24 UTC
Sorry, I'll email the log entries today.  This does happen sporadically, I'd say maybe 10% of the time we run sudo.  I should also mention we are not using SSSD for our sudo database, we are using the standard sudoers file.  However there are groups in sudoers that come from ldap via SSSD.

Comment 7 Jakub Hrozek 2013-08-02 10:53:37 UTC
(In reply to mleary from comment #6)
> Sorry, I'll email the log entries today.  This does happen sporadically, I'd
> say maybe 10% of the time we run sudo.  

Right, according to Pavel's investigation of the core file, the bug is actually a use-after-free problem, so chances are that the contents of the memory are still available despite beeing freed most of the time.

> I should also mention we are not
> using SSSD for our sudo database, we are using the standard sudoers file. 
> However there are groups in sudoers that come from ldap via SSSD.

Yep, the crash seems to have happened in the nested group processing.

Thanks for the logs, either me or Pavel would take a look..

Comment 8 Jakub Hrozek 2013-08-06 20:15:48 UTC
Hello Mark,

we believe we found the culprit. There was a use-after-free situation in one of the less probable branches of the nested group processing. I built test packages which are the same as the 6.4 ones, just with the additional fix on top. Can you try them out if you have a moment?

The builds are here:
http://jhrozek.fedorapeople.org/sssd-test-builds/sssd-nested-group-crash/

btw this is most likely the same issue as the one tracked in #963235

Comment 9 Jakub Hrozek 2013-08-08 08:18:18 UTC
Marking this bug as duplicate of #963235 as that one has more complete information.

*** This bug has been marked as a duplicate of bug 963235 ***