Bug 1123647

Summary: SELinux is preventing /usr/sbin/alsactl from 'read' accesses on the lnk_file /var/lock.
Product: [Fedora] Fedora Reporter: PDS <pds.oganin>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: akurtako, dominick.grift, dwalsh, ignatenko, lvrabec, mgrepl, pds.oganin, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:00ae93b89a84dad4907ab72d104ce7f9464f6abff609b4978df06722bf535db6
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-31 08:46:03 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:

Description PDS 2014-07-27 14:40:19 UTC
Description of problem:
SELinux is preventing /usr/sbin/alsactl from 'read' accesses on the lnk_file /var/lock.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that alsactl should be allowed read access on the lock lnk_file 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 alsactl /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:alsa_t:s0
Target Context                system_u:object_r:var_lock_t:s0
Target Objects                /var/lock [ lnk_file ]
Source                        alsactl
Source Path                   /usr/sbin/alsactl
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           alsa-utils-1.0.28-1.fc22.x86_64
Target RPM Packages           filesystem-3.2-27.fc22.x86_64
Policy RPM                    selinux-policy-3.13.1-67.fc22.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.16.0-0.rc6.git2.1.fc22.x86_64 #1
                              SMP Fri Jul 25 16:09:07 UTC 2014 x86_64 x86_64
Alert Count                   10
First Seen                    2014-07-26 09:01:39 MSK
Last Seen                     2014-07-27 13:23:22 MSK
Local ID                      c8f1e3e9-80bf-4779-97d7-30fbf976d3fa

Raw Audit Messages
type=AVC msg=audit(1406453002.871:712): avc:  denied  { read } for  pid=626 comm="alsactl" name="lock" dev="sdc4" ino=328 scontext=system_u:system_r:alsa_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=lnk_file permissive=0


type=SYSCALL msg=audit(1406453002.871:712): arch=x86_64 syscall=open success=no exit=EACCES a0=7fcd559f37b3 a1=c2 a2=1a4 a3=4000 items=0 ppid=1 pid=626 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=alsactl exe=/usr/sbin/alsactl subj=system_u:system_r:alsa_t:s0 key=(null)

Hash: alsactl,alsa_t,var_lock_t,lnk_file,read

Version-Release number of selected component:
selinux-policy-3.13.1-67.fc22.noarch

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.16.0-0.rc6.git3.1.fc22.x86_64
type:           libreport

Potential duplicate: bug 1123423

Comment 1 Miroslav Grepl 2014-07-30 11:51:21 UTC
Does alsa create a lock file? Are you able to reproduce it with

# semanage permissive -a alsa_t

reproduce and

# ausearch -m avc -ts recent
# semanage permissive -d alsa_t

Comment 2 Vít Ondruch 2014-07-30 17:58:25 UTC
This is the output:

$ sudo ausearch -m avc -ts recent
----
time->Wed Jul 30 19:52:20 2014
type=PROCTITLE msg=audit(1406742740.471:745): proctitle=2F7573722F7362696E2F616C736163746C002D73002D6E003139002D63002D4500414C53415F434F4E4649475F504154483D2F6574632F616C73612F616C736163746C2E636F6E66002D2D696E697466696C653D2F6C69622F616C73612F696E69742F30306D61696E00726461656D6F6E
type=SYSCALL msg=audit(1406742740.471:745): arch=c000003e syscall=2 success=yes exit=8 a0=7fba7ce8c7b3 a1=2 a2=7fff21daa81b a3=0 items=0 ppid=1 pid=735 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="alsactl" exe="/usr/sbin/alsactl" subj=system_u:system_r:alsa_t:s0 key=(null)
type=AVC msg=audit(1406742740.471:745): avc:  denied  { open } for  pid=735 comm="alsactl" path="/run/lock/asound.state.lock" dev="tmpfs" ino=89447 scontext=system_u:system_r:alsa_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=file permissive=1
type=AVC msg=audit(1406742740.471:745): avc:  denied  { read } for  pid=735 comm="alsactl" name="lock" dev="dm-1" ino=1966116 scontext=system_u:system_r:alsa_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=lnk_file permissive=1
----
time->Wed Jul 30 19:53:21 2014
type=PROCTITLE msg=audit(1406742801.780:15): proctitle=2F7573722F7362696E2F616C736163746C002D73002D6E003139002D63002D4500414C53415F434F4E4649475F504154483D2F6574632F616C73612F616C736163746C2E636F6E66002D2D696E697466696C653D2F6C69622F616C73612F696E69742F30306D61696E00726461656D6F6E
type=SYSCALL msg=audit(1406742801.780:15): arch=c000003e syscall=2 success=yes exit=4 a0=7ffecefe17b3 a1=2 a2=7fff628ff3db a3=0 items=0 ppid=1 pid=730 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="alsactl" exe="/usr/sbin/alsactl" subj=system_u:system_r:alsa_t:s0 key=(null)
type=AVC msg=audit(1406742801.780:15): avc:  denied  { open } for  pid=730 comm="alsactl" path="/run/lock/asound.state.lock" dev="tmpfs" ino=12892 scontext=system_u:system_r:alsa_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=file permissive=1
type=AVC msg=audit(1406742801.780:15): avc:  denied  { read } for  pid=730 comm="alsactl" name="lock" dev="dm-1" ino=1966116 scontext=system_u:system_r:alsa_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=lnk_file permissive=1


And lock file is created:

$ ls -la /run/lock/asound.state.lock
-rw-r--r--. 1 root root 11 30. čec 19.53 /run/lock/asound.state.lock

Comment 3 Miroslav Grepl 2014-07-31 08:46:03 UTC

*** This bug has been marked as a duplicate of bug 1123423 ***

Comment 4 Red Hat Bugzilla 2023-09-14 02:12:07 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days