Bug 1211010

Summary: SELinux is preventing restorecon from 'associate' accesses on the filesystem debug.
Product: [Fedora] Fedora Reporter: Moez Roy <moez.roy>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: dominick.grift, dwalsh, lvrabec, mgrepl, moez.roy, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:75260e83ba3b5986ce52c99a677e54ac0d159668daf72c6cbc07759e644561dd
Fixed In Version: selinux-policy-3.13.1-105.21.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1211721 (view as bug list) Environment:
Last Closed: 2015-10-17 23:20:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1211721    

Description Moez Roy 2015-04-12 04:02:32 UTC
Description of problem:
was trying to create a rawhide workstation livecd
SELinux is preventing restorecon from 'associate' accesses on the filesystem debug.

*****  Plugin filesystem_associate (99.5 confidence) suggests   **************

If you believe restorecon should be allowed to create debug files
Then you need to use a different command. You are not allowed to preserve the SELinux context on the target file system.
Do
use a command like "cp -p" to preserve all permissions except SELinux context.

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that restorecon should be allowed associate access on the debug filesystem by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep restorecon /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:object_r:debugfs_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                debug [ filesystem ]
Source                        restorecon
Source Path                   restorecon
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-105.9.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.19.2-201.fc21.x86_64 #1 SMP Tue
                              Mar 24 03:08:23 UTC 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2015-04-11 20:44:44 PDT
Last Seen                     2015-04-11 20:44:44 PDT
Local ID                      9c829e4e-b46e-4637-aa76-05ef76e97f9d

Raw Audit Messages
type=AVC msg=audit(1428810284.346:548): avc:  denied  { associate } for  pid=30291 comm="restorecon" name="debug" dev="sysfs" ino=744 scontext=system_u:object_r:debugfs_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=filesystem permissive=0


Hash: restorecon,debugfs_t,sysfs_t,filesystem,associate

Version-Release number of selected component:
selinux-policy-3.13.1-105.9.fc21.noarch

Additional info:
reporter:       libreport-2.3.0
hashmarkername: setroubleshoot
kernel:         3.19.2-201.fc21.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2015-04-13 12:51:46 UTC
(In reply to Moez Roy from comment #0)
> Description of problem:
> was trying to create a rawhide workstation livecd

Could you paste your steps?

Comment 2 Moez Roy 2015-04-13 14:23:15 UTC
(In reply to Miroslav Grepl from comment #1)
> (In reply to Moez Roy from comment #0)
> > Description of problem:
> > was trying to create a rawhide workstation livecd
> 
> Could you paste your steps?

yum install livecd-tools wget

wget https://kojipkgs.fedoraproject.org//work/tasks/8354/9468354/fedora-live-workstation-1564226.ks

mkdir cacheDir tmpDir

livecd-creator --config=fedora-live-workstation-1564226.ks --cache=cacheDir --tmpdir=tmpDir --verbose


Note: you should also see warnings like "/sbin/setfiles: tmpDir/something is not located in /etc/selinux/targeted/contexts/files/file_contexts"

Comment 3 Miroslav Grepl 2015-04-14 12:59:49 UTC
Added to rawhide

commit a0bf28db6a603defbc8ec2ee4c9b72c834edfe61
Author: Miroslav Grepl <mgrepl>
Date:   Tue Apr 14 14:58:59 2015 +0200

    Allow debugfs associate to a sysfs filesystem.

Comment 4 Moez Roy 2015-08-09 15:50:41 UTC
Description of problem:
Strange! I thought the fix was backported to F21?

Version-Release number of selected component:
selinux-policy-3.13.1-105.20.fc21.noarch

Additional info:
reporter:       libreport-2.3.0
hashmarkername: setroubleshoot
kernel:         4.1.3-100.fc21.x86_64
type:           libreport

Comment 5 Lukas Vrabec 2015-08-22 17:52:46 UTC
commit 556ea5007cd9824324445c38ce42a589b35ee578
Author: Miroslav Grepl <mgrepl>
Date:   Tue Apr 14 14:58:59 2015 +0200

    Allow debugfs associate to a sysfs filesystem.

Comment 6 Fedora Update System 2015-08-24 10:47:17 UTC
selinux-policy-3.13.1-105.21.fc21 has been submitted as an update to Fedora 21. https://bugzilla.redhat.com/show_bug.cgi?id=1211010

Comment 7 Fedora Update System 2015-08-24 22:22:18 UTC
selinux-policy-3.13.1-105.21.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update selinux-policy'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14070

Comment 8 Fedora Update System 2015-10-17 23:20:41 UTC
selinux-policy-3.13.1-105.21.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.