URL: https://github.com/SSSD/sssd/pull/899 Author: pbrezina Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback Action: opened
PR body: """ Setting `item->ptr = ptr` actually overwrote the original hash entry stored in the hash. If this entry is looked up in the delete callback it contains the overwritten value instead of the original.
Steps to reproduce: ``` 1. Run sssd 2. Call e.g. `id user-1` 3. Terminate SSSD ```
You will see these `Invalid data type` messages.
(Snippet from domain log) ``` [dp_client_destructor] (0x0400): Removed IFP client [sbus_signal_handler] (0x2000): Received D-Bus signal org.freedesktop.DBus.NameOwnerChanged on /org/freedesktop/DBus [sbus_signal_handler] (0x2000): Received D-Bus signal org.freedesktop.DBus.NameOwnerChanged on /org/freedesktop/DBus [sbus_senders_delete] (0x2000): Removing identity of sender [sssd.ifp] [sbus_issue_request_done] (0x0400): org.freedesktop.DBus.NameOwnerChanged: Success [sbus_senders_delete] (0x2000): Removing identity of sender [:1.5] [sbus_issue_request_done] (0x0400): org.freedesktop.DBus.NameOwnerChanged: Success [sbus_dispatch_reconnect] (0x0400): Connection lost. Terminating active requests. [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. ``` """
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/899/head:pr899 git checkout pr899
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
mzidek-rh commented: """ Will review this together with some other patches today. At first glance, the code LGTM. """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-542632797
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
mzidek-rh commented: """ @pbrezina Should the reproducer be deterministic? I can not see the messages in debug logs after calling "id Administrator". Am I missing something? """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-542809403
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
pbrezina commented: """ You need to also terminate SSSD after calling `id`. """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-543075964
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
pbrezina commented: """ Since this happens during termination. """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-543076087
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
mzidek-rh commented: """ @pbrezina Sorry for being unclear, but I did terminate the SSSD. No messages in the log after:
``` $ systemctl start sssd $ id Administrator $ id testuser $ systemctl stop sssd ```
I also tried with just one user or different users. """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-543084118
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
mzidek-rh commented: """ @pbrezina Sorry for being unclear, but I did terminate the SSSD. No messages in the log after:
``` $ systemctl start sssd $ id Administrator $ id testuser $ systemctl stop sssd ```
I also tried with just one user or different users.
EDIT: by "No messages" I mean, not the messages I was looking for (Invalid data...), of course there were other messages. I have debug level 10 set in sssd.conf """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-543084118
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
pbrezina commented: """ This works evertime: ``` # rm -f /var/log/sssd/* && systemctl start sssd && sleep 5 && systemctl stop sssd && grep "Invalid data type detected" /var/log/sssd/sssd_ldap.vm.log (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. ``` """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-543708753
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
pbrezina commented: """ This works evertime: ```bash # rm -f /var/log/sssd/* && systemctl start sssd && sleep 5 && systemctl stop sssd && grep "Invalid data type detected" /var/log/sssd/sssd_ldap.vm.log (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. ``` """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-543708753
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
pbrezina commented: """ This works evertime: ```bash $ rm -f /var/log/sssd/* && systemctl start sssd && sleep 5 && systemctl stop sssd && grep "Invalid data type detected" /var/log/sssd/sssd_ldap.vm.log (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. ``` """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-543708753
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
pbrezina commented: """ This works evertime: ``` # rm -f /var/log/sssd/* && systemctl start sssd && sleep 5 && systemctl stop sssd && grep "Invalid data type detected" /var/log/sssd/sssd_ldap.vm.log (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. (Fri Oct 18 12:15:05 2019) [sssd[be[ldap.vm]]] [sss_ptr_hash_check_type] (0x0020): Invalid data type detected. Expected [struct sss_ptr_hash_value], got [struct sbus_connection]. ``` """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-543708753
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
mzidek-rh commented: """ Hmm... not sure, but maybe I was trying to reproduce it with the patches already applied :/ Sorry.
In any case, I could reproduce it with master and master + this patch fixed it.
ACK. """
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-543747371
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
Label: +Accepted
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
Label: +Ready to push
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
pbrezina commented: """ * `master` * f95db37aa8486304d0569d12a876b1c74ee1b0d1 - sss_ptr_hash: pass new hash_entry_t to custom delete callback
"""
See the full comment at https://github.com/SSSD/sssd/pull/899#issuecomment-544430053
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
Label: +Pushed
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
Label: -Accepted
URL: https://github.com/SSSD/sssd/pull/899 Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback
Label: -Ready to push
URL: https://github.com/SSSD/sssd/pull/899 Author: pbrezina Title: #899: sss_ptr_hash: pass new hash_entry_t to custom delete callback Action: closed
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/899/head:pr899 git checkout pr899
sssd-devel@lists.fedorahosted.org