Bug 1316798
Summary: | krb5_cc_initialize() can fail with KRB5_FCC_INTERNAL when multiple processes share the same ccache filename | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dan Callaghan <dcallagh> |
Component: | krb5 | Assignee: | Robbie Harwood <rharwood> |
Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 25 | CC: | abokovoy, j, nalin, npmccallum, rharwood |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | https://github.com/krb5/krb5/pull/425 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-05-02 18:48:24 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
Dan Callaghan
2016-03-11 06:48:43 UTC
I feel like this could be fixed by *not* calling unlink() and not using O_CREAT|O_EXCL, but instead just open()ing with O_CREAT and then acquiring the write lock and then truncating. I haven't tried that approach though. And I'm not sure if there is some other reason why the unlink() might be desired, like in case the process has permissions on the directory but not the existing file, or it's a symlink instead of a real file etc. If the unlink() *is* still needed then it seems like the only correct alternative is to handle EEXIST properly instead of letting it leak out as KRB5_FCC_INTERNAL to the caller. Here is a patch which leaves unlink() but removes O_EXCL and instead does ftruncate() after acquiring the write lock. It fixes the race with the reproducer above, and it seems to work correctly. https://github.com/krb5/krb5/pull/425 Hi, thanks for writing a patch! I'll follow the upstream discussion and backport when something merges. This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle. Changing version to '25'. Upstream PR has been inactive for a year; closing. |