Skip to contentSkip to conversation

file labels during init process

DISCUSSION Carsten Grohmann 3 participants 3 messages Jun 4, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

This days I install the january release of SELinux on my SuSE 8.1.

Today I found this log message:
avc: denied { search } for pid=1 exe=/sbin/init path=/var/log dev=03:09 ino=6 scontext=system_u:system_r:init_t tcontext=system_u:object_r:file_t tclass=dir

I have a problem with this entry. The complete filesystem is labeled correct. The partition hda7 mounted as /var/log is also labled with the correct type. Could it be that the init process access the filesystem before the labels "grasp"?

part of the boot messages:
<6>Security Scaffold v1.0.0 initialized

<6>SELinux:  Initializing.
<6>SELinux:  Starting in permissive mode
<6>SELinux:  Registered NetFilter hooks

<6>There is already a security framework initialized, register_security failed.
<6>Failure registering capabilities with the kernel <6>selinux_register_security: Registering secondary module capability
<6>Capability LSM initialized
<6>SELinux: Completing initialization.
<4>security: loading policy configuration from /etc/security/selinux/policy.12
<4>security: 3 users, 5 roles, 904 types
<4>security: 29 classes, 159756 rules
<6>SELinux: initialized (dev 03:09, type reiserfs), uses PSIDs <6>SELinux: initialized (dev 00:06, type devpts), uses transition SIDs
<6>SELinux: initialized (dev 00:05, type pipefs), uses task SIDs <6>SELinux: initialized (dev 00:04, type tmpfs), uses transition SIDs
<6>SELinux: initialized (dev 00:03, type sockfs), uses task SIDs <6>SELinux: initialized (dev 00:02, type proc), uses genfs_contexts <6>SELinux: initialized (dev 00:01, type bdev), not configured for labeling
<6>SELinux: initialized (dev 00:00, type rootfs), not configured for labeling
<6>Freeing unused kernel memory: 244k freed
<4>avc: denied { search } for pid=1 exe=/sbin/init path=/var/log dev=03:09 ino=6 scontext=system_u:system_r:init_t tcontext=system_u:object_r:file_t tclass=dir
<6>Adding Swap: 264088k swap-space (priority 42) <6>SELinux: initialized (dev 03:01, type ext2), uses PSIDs <4>reiserfs: checking transaction log (device 03:05) ... <4>Using r5 hash to sort names
<4>ReiserFS version 3.6.25
<6>SELinux: initialized (dev 03:05, type reiserfs), uses PSIDs <4>reiserfs: checking transaction log (device 03:07) ... <4>Using r5 hash to sort names
<4>ReiserFS version 3.6.25
<6>SELinux: initialized (dev 03:07, type reiserfs), uses PSIDs <4>reiserfs: checking transaction log (device 03:08) ... <4>Using r5 hash to sort names
<4>ReiserFS version 3.6.25
<6>SELinux: initialized (dev 03:08, type reiserfs), uses PSIDs <4>reiserfs: checking transaction log (device 03:06) ... <4>Using r5 hash to sort names
<4>ReiserFS version 3.6.25
<6>SELinux: initialized (dev 03:06, type reiserfs), uses PSIDs

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 9 lines · Carsten Grohmann

Today I found this log message:
avc: denied { search } for pid=1 exe=/sbin/init path=/var/log dev=03:09 ino=6 scontext=system_u:system_r:init_t tcontext=system_u:object_r:file_t tclass=dir

I have a problem with this entry. The complete filesystem is labeled correct. The partition hda7 mounted as /var/log is also labled with the correct type. Could it be that the init process access the filesystem before the labels "grasp"?

No, I think that this reflects an attempt to access the /var/log mount point directory (left in file_t, since it is covered by the mounted directory by the time you run setfiles) before the partition has been mounted. If you drop into singleuser mode and unmount /var/log, you can label it at that point if you want a particular type on it.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
In reply to Carsten Grohmann
Quoted 9 lines · Carsten Grohmann

Today I found this log message:
avc: denied { search } for pid=1 exe=/sbin/init path=/var/log dev=03:09 ino=6 scontext=system_u:system_r:init_t tcontext=system_u:object_r:file_t tclass=dir

I have a problem with this entry. The complete filesystem is labeled correct. The partition hda7 mounted as /var/log is also labled with the correct type. Could it be that the init process access the filesystem before the labels "grasp"?

It looks like init accessed /var/log before the /var/log filesystem was mounted. As you apparently labeled the /var filesystem when /var/log was mounted it was not possible to label the /var/log mount-point directory. Therefore it had the default of file_t.

Probably it's best to put in a dontaudit rule for that.

Signature · 10 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.