Description of problem: Install Fedora 22 or Fedora 23 (clean). Upon reboot, run restorecon -r -v / and find that many files have labels fixed. Version-Release number of selected component (if applicable): All since time immemorial? How reproducible: Always Steps to Reproduce: 1. Clean install Fedora 22 or Fedora 23. 2. Reboot and run restorecon -r -v / Actual results: Many files have labels reset, example (incomplete) list: restorecon reset /usr/lib/modules/4.2.0-0.rc8.git0.1.fc23.i686/modules.symbols context system_u:object_r:modules_object_t:s0->system_u:object_r:modules_dep_t:s0 restorecon reset /boot/System.map-4.2.0-0.rc8.git0.1.fc23.i686 context system_u:object_r:modules_object_t:s0->system_u:object_r:system_map_t:s0 restorecon reset /boot/vmlinuz-4.2.0-0.rc8.git0.1.fc23.i686 context system_u:object_r:modules_object_t:s0->system_u:object_r:boot_t:s0 restorecon reset /var/lib/os-prober/labels context unconfined_u:object_r:user_tmp_t:s0->unconfined_u:object_r:bootloader_var_lib_t:s0 restorecon reset /var/log/dnf.log context system_u:object_r:rpm_log_t:s0->system_u:object_r:var_log_t:s0 restorecon reset /var/cache/dnf/updates-testing-200adbd074da487f/repodata/repomd.xml context system_u:object_r:rpm_tmp_t:s0->system_u:object_r:rpm_var_cache_t:s0 Expected results: I expect the installation should have correct labeling. Additional info:
This may or may not be relevant. However, after if after running restorecon you run "depmond" you will find that several files in /lib/modules/`uname -r` will have their contexts changed back to where they will be flagged as needed to be restored the next time restorecon is run.
Sorry, that should have read "depmod" in the above comment.
Created attachment 1069146 [details] restorecon F22 cloud atomic Fedora-Cloud_Atomic-x86_64 22.96 tree (current as of last week). Of course much of the filesystem is read only by design, so restorecon can't fix these things, and there's a metric fton of labels that restorecon wants to reset.
We need an equivalence label between /sysroot/ostree/deploy/fedora-atomic and / semanage fcontext -a -e / /sysroot/ostree/deploy/fedora-atomic Would fix the problem. But we should put this in base policy. It would be better if this was not OS Specific.
For OSTree we might want to exclude /sysroot/ostree/repo/objects alltogether. Since these are hard links, and we do not want to relabel them
Created attachment 1070156 [details] restorecon F23 Workstation Fedora-Live-Workstation-x86_64-23_Beta-TC1.iso
restorecon reset /usr/lib/modules/4.2.0-0.rc8.git0.1.fc23.i686/modules.symbols context system_u:object_r:modules_object_t:s0->system_u:object_r:modules_dep_t:s0 restorecon reset /boot/System.map-4.2.0-0.rc8.git0.1.fc23.i686 context system_u:object_r:modules_object_t:s0->system_u:object_r:system_map_t:s0 Is there any value in having these be different labeles. What is the security difference between modules_object_t, system_map_t and modules_dep_t. If there is nothing we are confining different, we should make them all the same. I don't think anything is allwoed to write to it. restorecon reset /boot/vmlinuz-4.2.0-0.rc8.git0.1.fc23.i686 context system_u:object_r:modules_object_t:s0->system_u:object_r:boot_t:s0 Probably just leaving it labeled modules_object_t would be fine. Looks like these are mv'd here from a subdir of /lib. If we changed the mv command that builds the vmlinux-* to use -Z it would probably fix the problem. And they could be labeled boot_t. I don't believe this mislabel would cause any problems. restorecon reset /var/lib/os-prober/labels context unconfined_u:object_r:user_tmp_t:s0->unconfined_u:object_r:bootloader_var_lib_t:s0 restorecon reset /var/log/dnf.log context system_u:object_r:rpm_log_t:s0->system_u:object_r:var_log_t:s0 restorecon reset /var/cache/dnf/updates-testing-200adbd074da487f/repodata/repomd.xml context system_u:object_r:rpm_tmp_t:s0->system_u:object_r:rpm_var_cache_t:s0 Thee all look like mv issues.
(In reply to Daniel Walsh from comment #7) > Thee all look like mv issues. The anaconda program.log doesn't show mv being used at all during installation. Instead it shows rsync -pogAXtlHrDx. Workstation is a live installation so it uses rsync. I originally found this on a Server netinstall which also isn't using mv as far as I can tell, it's using dnf/rpm.
Ok we have more bugs here. > We need an equivalence label between > > /sysroot/ostree/deploy/fedora-atomic and / > > semanage fcontext -a -e / /sysroot/ostree/deploy/fedora-atomic > > Would fix the problem. But we should put this in base policy. > > It would be better if this was not OS Specific. I see we have policy/modules/kernel/files.if: files_root_filetrans($1, usr_t, dir, "ostree") policy/modules/kernel/files.fc:/etc/ostree/remotes.d(/.*)? gen_context(system_u:object_r:system_conf_t,s0) policy/modules/kernel/files.fc:/ostree/repo(/.*)? gen_context(system_u:object_r:system_conf_t,s0) policy/modules/kernel/files.fc:/ostree/deploy/rhel-atomic-host/deploy(/.*)? gen_context(system_u:object_r:system_conf_t,s0) policy/modules/kernel/files.fc:/ostree(/.*)? gen_context(system_u:object_r:usr_t,s0
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. 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 '23'. 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 23 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 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 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.
I think basically we need: /sysroot <<none>> /ostree <<none>> in policy.
Need to open a pull request against https://github.com/fedora-selinux/selinux-policy
This message is a reminder that Fedora 26 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 26. 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 '26'. 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 26 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 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26 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.
`restorecon -Rv /` (as is sometimes suggested by SELinux developers, see e.g. https://bugzilla.redhat.com/show_bug.cgi?id=1631033) still totally breaks ostree-based systems. In the end we'll likely solve this with https://github.com/ostreedev/ostree/issues/1265 though.
This message is a reminder that Fedora 29 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26. 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 '29'. 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 29 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 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 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.
(In reply to Colin Walters from comment #17) > `restorecon -Rv /` (as is sometimes suggested by SELinux developers, see > e.g. https://bugzilla.redhat.com/show_bug.cgi?id=1631033) still totally > breaks ostree-based systems. > > In the end we'll likely solve this with > https://github.com/ostreedev/ostree/issues/1265 though. People keep stumble upon it, let's do something please! Now I broke my work Fedora Silverblue system with that restorecon, and I'm not the only one: https://discussion.fedoraproject.org/t/i-cant-boot-into-either-my-latest-or-previous-ostree-after-running-restorecon/ (I can’t boot into either my latest or previous ostree after running restorecon)
(In reply to Colin Walters from comment #17) > In the end we'll likely solve this with > https://github.com/ostreedev/ostree/issues/1265 though. The git issue is closed but the bug is still reproducible. Why is that?