Bug 1177989

Summary: rpm-ostree upgrade results in broken instance
Product: [Fedora] Fedora Reporter: Steven Dake <sdake>
Component: rpm-ostreeAssignee: Colin Walters <walters>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: agrimm, lsm5, mattdm, mgrepl, walters
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-12-02 06:42:11 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 Flags
audit log after rpm-ostree upgrade when booting into the image with selinux enabled. none

Description Steven Dake 2015-01-01 02:10:27 UTC
Created attachment 974915 [details]
audit log after rpm-ostree upgrade when booting into the image with selinux enabled.

Description of problem:
I ran Fedora Atomic Cloud image 21 inside a VM.  I then upgraded it using rpm-ostree upgrade.  I then rebooted it with a cloud config.  cloud-init entered the "failed" state as shown with systemctl | grep failed.  Placing the instance in permissive mode before saving the image permanently after an ostree upgrade results in a working cloud-init, so the problem involves selinux and rpm-ostree.

Version-Release number of selected component (if applicable):

released Fedora Atomic 21.
Upgraded to current ostree upgrade.

How reproducible:
100%

Actual results:
cloud-init does not bootstrap the instance properly

Expected results:
cloud-init bootstraps the instance properly


Additional info:
definately a problem with selinux.  audit.log attached.

Comment 1 Colin Walters 2015-01-04 01:27:53 UTC
There's multiple bugs here.

First: type=AVC msg=audit(1420077092.167:31): avc:  denied  { write } for  pid=18428 comm="passwd" name="shadow-" dev="dm-0" ino=4035221 scontext=system_u:system_r:passwd_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file permissive=0

This is https://bugzilla.redhat.com/show_bug.cgi?id=1178208


Next:

type=AVC msg=audit(1420077800.369:84): avc:  denied  { add_name } for  pid=972 comm="docker" name="docker" scontext=system_u:system_r:docker_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=dir permissive=1
type=AVC msg=audit(1420077800.369:85): avc:  denied  { create } for  pid=972 comm="docker" name="docker" scontext=system_u:system_r:docker_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=dir permissive=1
type=AVC msg=audit(1420077800.372:86): avc:  denied  { create } for  pid=972 comm="docker" name="key.json" scontext=system_u:system_r:docker_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=file permissive=1
type=AVC msg=audit(1420077800.373:87): avc:  denied  { write } for  pid=972 comm="docker" path="/etc/docker/key.json" dev="dm-0" ino=4035804 scontext=system_u:system_r:docker_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=file permissive=1

We probably should have etc_docker_t, but even if we introduced that now, it wouldn't work for upgrades.  So selinux-policy is going to need to allow docker_t write access to etc_t.  CC'd selinux-policy and docker-io package owners.

Comment 3 Fedora End Of Life 2015-11-04 13:50:43 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. 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 '21'.

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 21 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.

Comment 4 Fedora End Of Life 2015-12-02 06:42:16 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 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.