https://bugs.openldap.org/show_bug.cgi?id=9620
Issue ID: 9620 Summary: back-monitor: search can access a persistent entry freed in the meantime Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: backends Assignee: bugs@openldap.org Reporter: ondra@mistotebe.net Target Milestone: ---
With ITS#9600 there is now code that adds and removes "persistent" monitor entries outside a server pause. A concurrent cn=monitor search lists all children first and sends them later - monitor is happy to free some of them in the meantime.
It seems to me that the monitor cache should be protected by a rw mutex instead, which would be held for reading while a search is happening.
https://bugs.openldap.org/show_bug.cgi?id=9620
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.6.0
https://bugs.openldap.org/show_bug.cgi?id=9620
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@openldap.org |ondra@mistotebe.net
https://bugs.openldap.org/show_bug.cgi?id=9620
Ondřej Kuzník ondra@mistotebe.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |IN_PROGRESS
--- Comment #1 from Ondřej Kuzník ondra@mistotebe.net --- https://git.openldap.org/openldap/openldap/-/merge_requests/371
https://bugs.openldap.org/show_bug.cgi?id=9620
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |TEST Status|IN_PROGRESS |RESOLVED
--- Comment #2 from Quanah Gibson-Mount quanah@openldap.org ---
Commits: • 8d235737 by Ondřej Kuzník at 2021-08-06T18:51:51+00:00 ITS#9620 Only persistent entries are stored in the cache
• 60c21924 by Ondřej Kuzník at 2021-08-06T18:51:51+00:00 ITS#9620 Turn mi_cache_mutex into a RW lock
• 94b361ed by Ondřej Kuzník at 2021-08-06T18:51:51+00:00 ITS#9620 Freeze cache while we search
https://bugs.openldap.org/show_bug.cgi?id=9620
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |--- Status|RESOLVED |CONFIRMED
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- Needs further work
https://bugs.openldap.org/show_bug.cgi?id=9620
--- Comment #4 from Ondřej Kuzník ondra@mistotebe.net --- Changing the cache mutex into a R/W lock has introduced deadlocks between subtree cn=monitor searches and monitor_cache_add/_remove().
https://bugs.openldap.org/show_bug.cgi?id=9620
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CONFIRMED |RESOLVED Resolution|--- |TEST
--- Comment #5 from Quanah Gibson-Mount quanah@openldap.org --- • 397e30a5 by Ondřej Kuzník at 2021-10-05T11:05:25+01:00 ITS#9620 Fix deadlocks between searches and register_entry
https://bugs.openldap.org/show_bug.cgi?id=9620
--- Comment #6 from Quanah Gibson-Mount quanah@openldap.org --- RE26:
• 5a1da417 by Ondřej Kuzník at 2021-10-06T23:03:32+00:00 ITS#9620 Fix deadlocks between searches and register_entry
https://bugs.openldap.org/show_bug.cgi?id=9620
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED
https://bugs.openldap.org/show_bug.cgi?id=9620
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |FIXED
https://bugs.openldap.org/show_bug.cgi?id=9620
Ondřej Kuzník ondra@mistotebe.net changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.openldap.org/s | |how_bug.cgi?id=9832