Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File descriptors leak on server with kerberos export ticket & replay cache #414

Closed
franck-eyraud opened this issue Sep 9, 2016 · 2 comments
Assignees

Comments

@franck-eyraud
Copy link

This behaviour has been observed with package versions xrootd.x86_64 1:3.3.6-5.CERN.el7.cern and xrootd.x86_64 1:3.3.6-4.CERN.slc6.

Using EOS with kerberos authentication for which we activated ticket exportation (-exptkn option), we have experienced a file descriptors leak (files remain opened by the process) server-side (MGM), up to reaching the OS maximum limit of 65K fds per process after several days, causing service unavailability.
Files descriptors were pointing towards file located in /var/tmp directory, most of them were deleted and had a name with pattern krb5_RCxxxxx. The process also keeps several file descriptors toward the same existing file named after the principal used for the authentication.

It appeared that these files are replay cache. If we set KRB5RCACHEDIR, then files are found to this new location. And if we set KRB5RCACHETYPE=none no files are created, and no leak occurs.

We then realized that also when deactivating ticket exportation, the issue also doesn't occur. Since we in fact don't need it (we're not sure what is the role of that), this is what we did as a long term solution. But we still wanted to report the issue in case it makes sense.

Without having any knowledge about kerberos library, we noted that the function krb5_get_server_rcache is used to generate replay cache, but the krb5_rc_close is never mentioned in the code, however it is said to be necessary to clean up the resources.

@abh3 abh3 self-assigned this Sep 9, 2016
@abh3
Copy link
Member

abh3 commented Sep 9, 2016

Thank you for reporting this and indicating that we have a missing close().

@abh3 abh3 closed this as completed in 98628b1 Jan 20, 2017
@abh3
Copy link
Member

abh3 commented Jan 20, 2017

Actually, this is a bug in the kerberos library as we really do close the cache but the descriptor may still leak. This is a known issue and has been fixed in various version of kerberos but apparently not in the version being used here. The only mitigation is to not export tickets (which is not necessary).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants