/var/log/btmp getting mislabeled?

Tom London selinux at gmail.com
Thu Jan 3 15:29:35 UTC 2008


I just got this one logging in.  Looks like /var/log/btmp is getting mislabeled

Summary

SELinux is preventing gdm-simple-slav(/usr/libexec/gdm-simple-slave) (xdm_t)
"write" to (var_log_t).
Detailed Description

SELinux is preventing gdm-simple-slav(/usr/libexec/gdm-simple-slave) (xdm_t)
"write" to <Unknown> (var_log_t). The SELinux type var_log_t, 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, unlink, and append on (F2). But if for some reason a file
(<Unknown>) 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 <Unknown>. If the file context does not change from var_log_t,
then this is probably a bug in policy. Please file a bug report
(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
<Unknown>    The following command will allow this access:
    restorecon <Unknown>

Additional Information

Source Context                system_u:system_r:xdm_t:SystemLow-SystemHigh
Target Context                system_u:object_r:var_log_t
Target Objects                None [ file ]
Source                        gdm-simple-slav(/usr/libexec/gdm-simple-slave)
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages
Target RPM Packages
Policy RPM                    selinux-policy-3.2.5-7.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   mislabeled_file
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain
                              2.6.24-0.133.rc6.git8.fc9 #1 SMP Wed Jan 2
                              18:40:29 EST 2008 i686 i686
Alert Count                   1
First Seen                    Thu 03 Jan 2008 07:19:37 AM PST
Last Seen                     Thu 03 Jan 2008 07:19:37 AM PST
Local ID                      f5de46fe-618f-4bc4-9bae-e0a5c22c3343
Line Numbers

Raw Audit Messages

host=localhost.localdomain type=AVC msg=audit(1199373577.824:19): avc:
 denied  { write } for  pid=2544 comm="gdm-simple-slav" name="btmp"
dev=dm-0 ino=66570 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023
tcontext=system_u:object_r:var_log_t:s0 tclass=file

host=localhost.localdomain type=SYSCALL msg=audit(1199373577.824:19):
arch=40000003 syscall=5 success=no exit=-13 a0=8060c66 a1=8001 a2=0
a3=8060c70 items=0 ppid=2484 pid=2544 auid=4294967295 uid=0 gid=0
euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none)
comm="gdm-simple-slav" exe="/usr/libexec/gdm-simple-slave"
subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 key=(null)

---------
[root at localhost log]# restorecon -v -R /var/log
restorecon reset /var/log/btmp context
system_u:object_r:var_log_t:s0->system_u:object_r:faillog_t:s0
restorecon reset /var/log/rpmpkgs context
system_u:object_r:cron_log_t:s0->system_u:object_r:rpm_log_t:s0
[root at localhost log]#



-- 
Tom London




More information about the fedora-selinux-list mailing list