Bug 972731
Summary: | cryptkeeper-0.9.5-7.fc19.x86_64 segfaults in Rawhide (glibc-2.17.90-1.fc20.x86_64) | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tom London <selinux> | ||||
Component: | cryptkeeper | Assignee: | Hicham HAOUARI <hicham.haouari> | ||||
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 20 | CC: | hicham.haouari | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2015-06-29 12:00:12 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: | |||||||
Attachments: |
|
Description
Tom London
2013-06-10 13:35:50 UTC
Should have include the following above: [tbl@tlondon x86_64]$ rpm -qf /usr/share/glib-2.0/gdb/gobject.py glib2-devel-2.37.1-1.fc20.x86_64 [tbl@tlondon x86_64]$ Looks like the crash is occurring when strcmp() dereferences 'mnt_dir_expanded' in the 'for' loop: bool is_mounted(const char *mount_dir) { FILE *f = setmntent("/etc/mtab", "r"); char *mount_dir_expanded = realpath(mount_dir, NULL); if (mount_dir_expanded == NULL) { // no such file or dir, ... // so: not mounted // perror("cryptkeeper, is_mounted"); return false; } for (;;) { char *mnt_dir_expanded; struct mntent *m = getmntent(f); if (!m) break; mnt_dir_expanded = realpath(m->mnt_dir, NULL); if (strcmp(mount_dir_expanded, mnt_dir_expanded)==0) { free(mnt_dir_expanded); return true; } } return false; } So the call to 'realpath()' is returning NULL. Appears that this can happen if there is a permission issue: EACCES Read or search permission was denied for a component of the path prefix. On a hunch, I put SELinux into permissive mode (via 'setenforce 0'), and retried. This time, no segfault. No AVCs, so I will have dig deeper to figure out what access is being denied, and then file against SELinux. Not sure cryptkeeper should segfault in this case however.... Upon some thought, I'm thinking that the cryptkeeper code needs changing. I believe the SELinux access that is being prevented is when the call to realpath() is attempting to access the full path of every mountpoint. This AVC is 'dontaudit-ed', so one would normally not see it, but the code does not expect the call to realpath() to return NULL. The simplest fix would be to modify the code to recognize a NULL return and just continue to the next mount point. A better(?) fix could be changing the code to scan /proc/mounts directly, and to bypass the call to realpath() on the scanned mount point. I'll post a patch (for the simple fix) below. Created attachment 762496 [details]
Patch to encfs_wrapper.cpp to check for realpath() returning NULL
Simplest patch to avoid segfaults when there is a mountpoint that a user doesn't have the right access permissions....
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle. Changing version to '20'. More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20 This message is a reminder that Fedora 20 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 20. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '20'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 20 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |