Bug 652989 - SELinux is preventing /bin/login "read" access on nologin.
Summary: SELinux is preventing /bin/login "read" access on nologin.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 14
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:2111d75ea1c...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-14 00:19 UTC by Cristian Ciupitu
Modified: 2010-11-21 22:00 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.9.7-12.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-21 22:00:59 UTC
Type: ---


Attachments (Terms of Use)

Description Cristian Ciupitu 2010-11-14 00:19:56 UTC
Summary:

SELinux is preventing /bin/login "read" access on nologin.

Detailed Description:

SELinux denied access requested by login. It is not expected that this access is
required by login and this access may signal an intrusion attempt. It is also
possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                system_u:system_r:local_login_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:shutdown_etc_t:s0
Target Objects                nologin [ file ]
Source                        login
Source Path                   /bin/login
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           util-linux-ng-2.18-4.4.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-10.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.35.6-48.fc14.x86_64 #1 SMP Fri Oct 22 15:36:08
                              UTC 2010 x86_64 x86_64
Alert Count                   1
First Seen                    Sun 14 Nov 2010 01:54:34 AM EET
Last Seen                     Sun 14 Nov 2010 01:54:34 AM EET
Local ID                      9c7fbb98-283d-42b4-b6c3-3e7974cf266d
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1289692474.813:196): avc:  denied  { read } for  pid=15176 comm="login" name="nologin" dev=dm-0 ino=413446 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:shutdown_etc_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1289692474.813:196): arch=c000003e syscall=2 success=no exit=-13 a0=7fb1600cbc16 a1=0 a2=0 a3=0 items=0 ppid=1 pid=15176 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty3 ses=4294967295 comm="login" exe="/bin/login" subj=system_u:system_r:local_login_t:s0-s0:c0.c1023 key=(null)



Hash String generated from  catchall,login,local_login_t,shutdown_etc_t,file,read
audit2allow suggests:

#============= local_login_t ==============
allow local_login_t shutdown_etc_t:file read;

Comment 1 Daniel Walsh 2010-11-15 15:10:25 UTC
Where is this nologin file located?

 locate -r /nologin$

Comment 2 Cristian Ciupitu 2010-11-15 15:54:51 UTC
/sbin/nologin

Comment 3 Daniel Walsh 2010-11-15 15:55:55 UTC
ls -lZ /sbin/nologin

Comment 4 Cristian Ciupitu 2010-11-15 16:03:19 UTC
-rwxr-xr-x. root root system_u:object_r:shell_exec_t:s0 /sbin/nologin

Comment 5 Daniel Walsh 2010-11-15 16:18:24 UTC
Well I have no idea.

find /etc -name nologin

If this does not give you a file nologin, then I guess we will have to wait to see if it happens again.

Comment 6 Cristian Ciupitu 2010-11-15 16:33:01 UTC
I was almost sure that I should have given you all the nologin files :-)

[root@hermes ~]# locate nologin
/lib64/security/pam_nologin.so
/sbin/nologin
/usr/share/doc/pam-1.1.1/html/sag-pam_nologin.html
/usr/share/doc/pam-1.1.1/txts/README.pam_nologin
/usr/share/man/man5/nologin.5.gz
/usr/share/man/man8/nologin.8.gz
/usr/share/man/man8/pam_nologin.8.gz

The denial appeared to me only two times and I think that it happens when I login to GNOME from GDM, but I'm not sure. I use hibernate a lot, so I don't login very often.

Comment 7 Daniel Walsh 2010-11-15 17:00:40 UTC
The AVC is specific in stating it is the login program trying to read a file named "nologin" that is labeled shutdown_etc_t.



So none of your files match that signature.

Comment 8 Petr Lautrbach 2010-11-18 10:39:34 UTC
/etc/nologin file is created by /sbin/shutdown -> ../lib/upstart/shutdown
during shutdown process. It is used by pam_nologin(8) to avoid new users login
into the system.

# shutdown +5 &
...

wait one minute

# ls -lZ /etc/nologin
-rw-r--r--. root root unconfined_u:object_r:shutdown_etc_t:s0 /etc/nologin

Now when you try to login via console you shouldn't be able to login but you are and you can see this AVC:

type=AVC msg=audit(1290076367.264:1295): avc:  denied  { read } for  pid=28940 comm="login" name="nologin" dev=dm-0 ino=139761 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:shutdown_etc_t:s0 tclass=file
type=SYSCALL msg=audit(1290076367.264:1295): arch=c000003e syscall=2 success=no exit=-13 a0=7f5580fe8c16 a1=0 a2=0 a3=0 items=0 ppid=1 pid=28940 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttyS0 ses=4294967295 comm="login" exe="/bin/login" subj=system_u:system_r:local_login_t:s0-s0:c0.c1023 key=(null)

Comment 9 Miroslav Grepl 2010-11-18 10:48:21 UTC
Now it is clear. Thanks Petr.

Cristian,
you can allow it for now using

# grep local_login_t /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Comment 10 Daniel Walsh 2010-11-18 13:24:56 UTC
	files_read_config_files($1)

in auth_login_pgm_domain

Will fix this.

Comment 11 Miroslav Grepl 2010-11-18 14:58:17 UTC
Fixed in selinux-policy-3.9.7-12.fc14

Comment 12 Fedora Update System 2010-11-19 13:22:47 UTC
selinux-policy-3.9.7-12.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-12.fc14

Comment 13 Fedora Update System 2010-11-19 22:41:00 UTC
selinux-policy-3.9.7-12.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-12.fc14

Comment 14 Fedora Update System 2010-11-21 21:59:20 UTC
selinux-policy-3.9.7-12.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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