Skip to contentSkip to conversation

stripped mount point

DISCUSSION Timothy Wood 2 participants 2 messages Aug 20, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

I just relabeled the files on my system and now my apache processes can not read from the doc root nor can they append to the logs. Now I noticed when I relabeled the fs that each mount point was done independently whereas before it would just label everything as being under / (eg it labeled /, then it labeled /var, then /tmp, etc., etc.). The files are all labeled correctly but the avc messages have the mount points stripped from the path section (eg apache isn't denied access to /var/www/html it is denied access to /www/html). Now I can see how this is causing a problem the question is why is it doing this?

Timothy,

avc: denied { read } for pid=1598 exe=/usr/sbin/httpd path=/www/html/index.php dev=03:08 ino=60255 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:httpd_sys_content_t tclass=file

avc: denied { append } for pid=1598 exe=/usr/sbin/httpd path=/log/httpd/access_log dev=03:08 ino=50210 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:httpd_log_files_t tclass=file

--
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 11 lines · Timothy Wood

I just relabeled the files on my system and now my apache processes can not read from the doc root nor can they append to the logs. Now I noticed when I relabeled the fs that each mount point was done independently whereas before it would just label everything as being under / (eg it labeled /, then it labeled /var, then /tmp, etc., etc.). The files are all labeled correctly but the avc messages have the mount points stripped from the path section (eg apache isn't denied access to /var/www/html it is denied access to /www/html). Now I can see how this is causing a problem the question is why is it doing this?

From your audit logs, you can see that httpd is running in the wrong

domain (initrc_t rather than httpd_t). This suggests that /usr/sbin/httpd is not labeled with httpd_exec_t and needs to be relabeled. After relabeling /usr/sbin/httpd (either by running chcon directly or by running 'make relabel' again), run 'run_init /etc/init.d/httpd restart' to restart the daemon in the correct domain.

With regard to the relabeling, setfiles is always applied to each filesystem (partition) in turn, since each filesystem must contain its own persistent label mapping. You are presumably seeing a change because you now have multiple partitions whereas you must have previously only had one.

With regard to auditing, the audit path is expected to be relative to the root of each filesystem, since we cannot reliably reconstruct any kind of "absolute" pathname from many of the locations in the kernel where a permission check is performed. However, the audit path is not relevant to the access control enforcement - SELinux is inode-based, not path-based. The audit path is merely intended to assist in understanding the audit message.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
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.