Bug 722207

Summary: SELinux is preventing /usr/sbin/sshd from 'read' accesses on the file /etc/localtime.
Product: [Fedora] Fedora Reporter: luigi <l.piro>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:63e2fe73948a0da3e9923260e566e65f9d8213cfc08c182b1c8d382546a32cf3
Fixed In Version: selinux-policy-3.9.7-44.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-12 11:01:57 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 luigi 2011-07-14 15:49:57 UTC
SELinux is preventing /usr/sbin/sshd from 'read' accesses on the file /etc/localtime.

*****  Plugin catchall_boolean (89.3 confidence) suggests  *******************

If you want to allow sftp-internal to login to local users and read/write all files on the system, governed by DAC.
Then you must tell SELinux about this by enabling the 'sftpd_full_access' boolean.
Do
setsebool -P sftpd_full_access 1

*****  Plugin catchall (11.6 confidence) suggests  ***************************

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

Additional Information:
Source Context                system_u:system_r:sftpd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:locale_t:s0
Target Objects                /etc/localtime [ file ]
Source                        sshd
Source Path                   /usr/sbin/sshd
Port                          <Sconosciuto>
Host                          (removed)
Source RPM Packages           openssh-server-5.5p1-24.fc14.2
Target RPM Packages           glibc-2.13-1
Policy RPM                    selinux-policy-3.9.7-42.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.13-92.fc14.i686 #1 SMP Sat May
                              21 17:39:42 UTC 2011 i686 i686
Alert Count                   530
First Seen                    ven 01 apr 2011 16:12:20 CEST
Last Seen                     gio 14 lug 2011 17:00:51 CEST
Local ID                      94de95c1-7c4f-4854-adf7-38a12dac63c3

Raw Audit Messages
type=AVC msg=audit(1310655651.141:39587): avc:  denied  { read } for  pid=21141 comm="sshd" name="localtime" dev=dm-0 ino=1707215 scontext=system_u:system_r:sftpd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:locale_t:s0 tclass=file


type=SYSCALL msg=audit(1310655651.141:39587): arch=i386 syscall=open success=no exit=EACCES a0=86d907 a1=0 a2=1b6 a3=86c477 items=0 ppid=21121 pid=21141 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=241 comm=sshd exe=/usr/sbin/sshd subj=system_u:system_r:sftpd_t:s0-s0:c0.c1023 key=(null)

Hash: sshd,sftpd_t,locale_t,file,read

audit2allow

#============= sftpd_t ==============
#!!!! This avc can be allowed using the boolean 'sftpd_full_access'

allow sftpd_t locale_t:file read;

audit2allow -R

#============= sftpd_t ==============
#!!!! This avc can be allowed using the boolean 'sftpd_full_access'

allow sftpd_t locale_t:file read;

Comment 1 Miroslav Grepl 2011-07-14 16:06:44 UTC
Are you trying to get localtime file using sftpd?

Comment 2 Daniel Walsh 2011-07-14 17:34:32 UTC
Miroslav just add the following to RHEL6, F14, F15

miscfiles_read_localization(anon_sftpd_t)

miscfiles_read_localization(sftpd_t)

Comment 3 luigi 2011-07-15 08:44:51 UTC
(In reply to comment #1)
> Are you trying to get localtime file using sftpd?

Hi,
I am using the sftp internal to ssh, in sshd_config I set:
Subsystem sftp internal-sftp

the bug reported above shows up when I upload with sftp a file to the server

thanks
Luigi

Comment 4 Miroslav Grepl 2011-08-04 09:32:04 UTC
Fixed in selinux-policy-3.9.7-44.fc14

Comment 5 Fedora Update System 2011-08-04 13:58:46 UTC
selinux-policy-3.9.7-44.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-44.fc14

Comment 6 Fedora Update System 2011-08-05 03:53:54 UTC
Package selinux-policy-3.9.7-44.fc14:
* should fix your issue,
* was pushed to the Fedora 14 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.9.7-44.fc14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-44.fc14
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2011-08-12 11:00:54 UTC
selinux-policy-3.9.7-44.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2011-08-12 18:25:20 UTC
selinux-policy-3.9.7-44.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.