From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070607 Swiftweasel/2.0.0.4 Description of problem: prelink moves the old executable out of the way, builds the new prelinked version and replaces it. This effectively removes the CAP. I had installed file-based capabilities like this within an RPM %post scriptlet: /usr/sbin/setcap cap_audit_write+pe /usr/libexec/AuditProxy If one of the linked libs changes, the prelink sweep will rebuild the executable and remove the CAP. At this point my rpm -V fails, since I have installed a %verifyscript: %verifyscript /usr/sbin/getcap /usr/libexec/AuditProxy | grep -q cap_audit_write+ep [ $? = 1 ] && echo "CAP_AUDIT_WRITE not set" >&2 && exit 1 exit 0 More importantly, though, is that the CAP is not set and all intended actions fail at this point. Version-Release number of selected component (if applicable): prelink-0.4.0-3 How reproducible: Always Steps to Reproduce: 1.ensure compiler is installed 2.create test directory and cd there 3.echo "int main() {}" > test.c 4.cc test.c 5.sudo /usr/sbin/setcap cap_audit_write+pe a.out 6.$ /usr/sbin/getcap a.out a.out = cap_audit_write+ep 7.sudo /usr/sbin/prelink -m a.out 8./usr/sbin/getcap a.out (nothing) Actual Results: The file-based CAP cap_audit_write was removed by the prelink. Expected Results: prelink should: 1. see if caps are available 2. check to see what CAPs are installed 3. restore those caps after prelinking Additional info: I will initially set this to medium, however it does pose a security issue that needs to be addressed.
This message is a reminder that Fedora 9 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 9. 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 WONTFIX if it remains open with a Fedora 'version' of '9'. 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 prior to Fedora 9's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 9 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 please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. 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. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Still unfixed on F11.
This message is a reminder that Fedora 11 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 11. 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 WONTFIX if it remains open with a Fedora 'version' of '11'. 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 prior to Fedora 11's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 11 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 please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. 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. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
The bug is still present in F12 and F13.
This message is a reminder that Fedora 12 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 12. 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 WONTFIX if it remains open with a Fedora 'version' of '12'. 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 prior to Fedora 12's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 12 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 please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. 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. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Still present in F14 and rawhide.
hmm, but using prelink without "-m" don't drop file capability, if you follow the same first example.
It does for me regardless of -m presence.
So, should I just fgetxattr ... "security.capability" and setxattr it on the new file, or for other capabilities as well (say listxattr and iterate over attributes)? In the latter case I guess I'd need to blacklist SELinux related acls, because those ought to be handled by using the -lselinux APIs. Wonder what does e.g. rpm do, does it care just about SELinux context and security.capability caps, or something else too?
(In reply to comment #8) > It does for me regardless of -m presence. Yes, my mistake. With rpm -q --qf '%{VERSION}-%{RELEASE}\n' prelink 0.4.3-4.fc14 seems working now /usr/sbin/setcap cap_audit_write+pe a.out prelink a.out getcap a.out a.out = cap_audit_write+ep prelink -m a.out getcap a.out a.out = cap_audit_write+ep setfacl -m u:root:rx a.out prelink -m a.out getfacl a.out # file: a.out # owner: root # group: root user::rwx user:root:r-x group::rwx mask::rwx other::r-x So, the problem is closed now ?
No, what I am saying that it is still broken regardless of -m. Subsequent prelink runs probably do not rewrite the file at all.
*** Bug 649972 has been marked as a duplicate of this bug. ***
(In reply to comment #9) > So, should I just fgetxattr ... "security.capability" and setxattr it on the > new file, or for other capabilities as well (say listxattr and iterate over > attributes)? In the latter case I guess I'd need to blacklist SELinux related > acls, because those ought to be handled by using the -lselinux APIs. > > Wonder what does e.g. rpm do, does it care just about SELinux context and > security.capability caps, or something else too? From rpm POV those are enough currently, but you'll want to copy ACL's too if present. Rpm doesn't currently have a way to specify them through packaging, but if set by admin, prelink shouldn't strip them.
Created attachment 462093 [details] prelink-xattr.patch Lightly tested patch.
Test packages built in http://koji.fedoraproject.org/scratch/jakub/task_2617107/
In prelink-0.4.4-1.fc15.