Bug 709204 - SELinux is preventing /bin/bash from 'read' accesses on the lnk_file /var/lock.
Summary: SELinux is preventing /bin/bash from 'read' accesses on the lnk_file /var/lock.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 15
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:fbf62523fd4...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-31 04:31 UTC by Alice K
Modified: 2011-06-11 08:04 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-31 15:44:22 UTC
Type: ---


Attachments (Terms of Use)

Description Alice K 2011-05-31 04:31:49 UTC
SELinux is preventing /bin/bash from 'read' accesses on the lnk_file /var/lock.

*****  Plugin restorecon (94.8 confidence) suggests  *************************

If you want to fix the label. 
/var/lock default label should be var_lock_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /var/lock

*****  Plugin catchall_labels (5.21 confidence) suggests  ********************

If you want to allow bash to have read access on the lock lnk_file
Then you need to change the label on /var/lock
Do
# semanage fcontext -a -t FILE_TYPE '/var/lock'
where FILE_TYPE is one of the following: etc_runtime_t, var_run_t, home_root_t, udev_var_run_t, var_lock_t, bin_t, cert_t, usr_t, device_t, devlog_t, locale_t, dhcpc_t, etc_t, proc_t, sysfs_t, dhcp_etc_t, abrt_t, lib_t, root_t, device_t, var_run_t, ld_so_t, proc_t, textrel_shlib_t, proc_net_t, proc_xen_t, rpm_script_tmp_t. 
Then execute: 
restorecon -v '/var/lock'


*****  Plugin catchall (1.44 confidence) suggests  ***************************

If you believe that bash 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 dhclient-script /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:system_r:dhcpc_t:s0-s0:c0.c1023
Target Context                system_u:object_r:var_t:s0
Target Objects                /var/lock [ lnk_file ]
Source                        dhclient-script
Source Path                   /bin/bash
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           bash-4.2.10-2.fc15
Target RPM Packages           filesystem-2.4.41-1.fc15
Policy RPM                    selinux-policy-3.9.16-24.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.6-27.fc15.x86_64 #1 SMP
                              Sun May 15 17:23:28 UTC 2011 x86_64 x86_64
Alert Count                   2
First Seen                    Tue 31 May 2011 10:37:10 AM MYT
Last Seen                     Tue 31 May 2011 11:19:32 AM MYT
Local ID                      35718871-9d04-4020-afff-8be85cd5eb70

Raw Audit Messages
type=AVC msg=audit(1306811972.763:60): avc:  denied  { read } for  pid=1810 comm="dhclient-script" name="lock" dev=dm-1 ino=132082 scontext=unconfined_u:system_r:dhcpc_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_t:s0 tclass=lnk_file


type=SYSCALL msg=audit(1306811972.763:60): arch=x86_64 syscall=stat success=no exit=EACCES a0=1668610 a1=7fff78969be0 a2=7fff78969be0 a3=8 items=0 ppid=1778 pid=1810 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm=dhclient-script exe=/bin/bash subj=unconfined_u:system_r:dhcpc_t:s0-s0:c0.c1023 key=(null)

Hash: dhclient-script,dhcpc_t,var_t,lnk_file,read

audit2allow

#============= dhcpc_t ==============
allow dhcpc_t var_t:lnk_file read;

audit2allow -R

#============= dhcpc_t ==============
allow dhcpc_t var_t:lnk_file read;

Comment 1 Miroslav Grepl 2011-05-31 07:15:26 UTC
Please, execute

# restorecon -R -v /var

will fix.


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