Bug 242255 - SELinux is preventing /sbin/alsactl (alsa_t) "write" to etc (etc_t).
Summary: SELinux is preventing /sbin/alsactl (alsa_t) "write" to etc (etc_t).
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 7
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-06-02 19:08 UTC by Jonathan Underwood
Modified: 2007-11-30 22:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-06-04 18:11:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jonathan Underwood 2007-06-02 19:08:26 UTC
Description of problem:
On resume from suspend I get this error:


Summary
    SELinux is preventing /sbin/alsactl (alsa_t) "write" to etc (etc_t).

Detailed Description
    SELinux is preventing /sbin/alsactl (alsa_t) "write" to etc (etc_t). The
    SELinux type %TARGET_TYPE, is a generic type for all files in the directory
    and very few processes (SELinux Domains) are allowed to write to this
    SELinux type.  This type of denial usual indicates a mislabeled file.  By
    default a file created in a directory has the gets the context of the parent
    directory, but SELinux policy has rules about the creation of directories,
    that say if a process running in one SELinux Domain (D1) creates a file in a
    directory with a particular SELinux File Context (F1) the file gets a
    different File Context (F2).  The policy usually allows the SELinux Domain
    (D1) the ability to write or append on (F2).  But if for some reason a file
    (etc) was created with the wrong context, this domain will be denied.  The
    usual solution to this problem is to reset the file context on the target
    file, restorecon -v etc.  If the file context does not change from etc_t,
    then this is probably a bug in policy.  Please file a
    http://bugzilla.redhat.com/bugzilla/enter_bug.cgi against the selinux-policy
    package. If it does change, you can try your application again to see if it
    works.  The file context could have been mislabeled by editing the file or
    moving the file from a different directory, if the file keeps getting
    mislabeled, check the init scripts to see if they are doing something to
mislabel the file.

Allowing Access
    You can attempt to fix file context by executing restorecon -v etc

    The following command will allow this access:
    restorecon etc

Additional Information        

Source Context                system_u:system_r:alsa_t
Target Context                system_u:object_r:etc_t
Target Objects                etc [ dir ]
Affected RPM Packages         alsa-utils-1.0.14-0.5.rc2.fc7
                              [application]filesystem-2.4.6-1.fc7 [target]
Policy RPM                    selinux-policy-2.6.4-8.fc7
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   plugins.mislabeled_file
Host Name                     renton.jgu
Platform                      Linux renton.jgu 2.6.21-1.3194.fc7 #1 SMP Wed May

                              [application]filesystem-2.4.6-1.fc7 [target]
Policy RPM                    selinux-policy-2.6.4-8.fc7
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   plugins.mislabeled_file
Host Name                     renton.jgu
Platform                      Linux renton.jgu 2.6.21-1.3194.fc7 #1 SMP Wed May
                              23 22:47:07 EDT 2007 x86_64 x86_64
Alert Count                   1
First Seen                    Sat 02 Jun 2007 07:04:09 PM BST
Last Seen                     Sat 02 Jun 2007 07:04:09 PM BST
Local ID                      976b3176-a7a1-4e45-844a-44f2f14eee0a
Line Numbers                  

Raw Audit Messages            

avc: denied { write } for comm="alsactl" dev=sda2 egid=0 euid=0
exe="/sbin/alsactl" exit=-13 fsgid=0 fsuid=0 gid=0 items=0 name="etc" pid=3144
scontext=system_u:system_r:alsa_t:s0 sgid=0 subj=system_u:system_r:alsa_t:s0
suid=0 tclass=dir tcontext=system_u:object_r:etc_t:s0 tty=(none) uid=0

Comment 1 Daniel Walsh 2007-06-04 16:26:48 UTC
restorecon -R -v /etc/asound.state should fix.


Note You need to log in before you can comment on or make changes to this bug.