mdns_maintenance_query_complete() takes a reference on query->dnsservice_request and never drops it, so every successful mDNS maintenance query leaks one reference to the discovered service. The leak alone would be benign, but the service owns the one-shot event source that drives its maintenance schedule, and it only borrows a plain pointer to its service browser. Once the extra reference is outstanding, dns_service_browser_free() -> dns_remove_service() only drops the list's reference, so dns_service_free() never runs, the maintenance timer is never disabled, and the service outlives the browser it points at. The next time the timer fires, mdns_maintenance_query() dereferences the freed DnsServiceBrowser to reach the manager's event loop and to issue the query. Reaching it only takes a browse subscription whose record lives long enough for one maintenance query to be answered, followed by the subscription going away. Make the reference a _cleanup_ one, the way the sibling mdns_browse_service_query_complete() below already handles the reference it takes on the service browser.
System and Service Manager
Details
Most documentation is available on systemd's website.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel
Stable branches with backported patches are available in the stable repo.
We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack
Repositories with distribution packages built from git main are available on OBS, and also repositories with packages built from the latest stable release
