scontext/tcontext/tclass
Hi all,
Hopefully this is very basic stuff, but I'm not sure how to read some of the error messages I'm seeing. To wit:
avc: denied { kill } for pid=14271 exe=/usr/sbin/identd capability=5
scontext=system_u:system_r:inetd_child_t tcontext=system_u:system_r:inetd_child_t tclass=capability
avc: denied { append } for pid=27031 exe=/usr/sbin/crond path=/var/log/cron dev=03:01 ino=99291
scontext=system_u:system_r:crond_t tcontext=system_u:object_r:xfs_tmp_t tclass=file
As I suspect getting these errors cleared up is a reasonable first goal in working with selinux, I wonder if someone would point out to me the difference between scontext and tcontext and make just one little light bulb come on here. I've been rtfm'ing for a while here and must be looking right at it, but it's not getting through.
Mark
Signature · 8 lines
I took a course in speed reading and was able to read War and Peace in
twenty minutes. It's about Russia.
-- Woody Allen
--
You have received this message because you are subscribed to the selinux list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.Mark,
The scontext is the source context. This is the file that is trying to
do the accessing. The tcontext is the target context. This is context of the file that is being accessed. In the case of your second error, the scontext is the context of the crond daemon and the tcontext is the context of the /var/log/cron file. The error message is saying that crond with a context of system_u:system_r:crond_t is trying to append to /var/log/cron that has a context of system_u:object_r:xfs_tmp_t.
Hope that helps clear up any confusion.
Thanks
Jen
Quoted 29 lines
Hi all,
Hopefully this is very basic stuff, but I'm not sure how to read some of the error messages I'm seeing. To wit:
avc: denied { kill } for pid=14271 exe=/usr/sbin/identd capability=5
scontext=system_u:system_r:inetd_child_t tcontext=system_u:system_r:inetd_child_t tclass=capabilityavc: denied { append } for pid=27031 exe=/usr/sbin/crond path=/var/log/cron dev=03:01 ino=99291
scontext=system_u:system_r:crond_t tcontext=system_u:object_r:xfs_tmp_t tclass=fileAs I suspect getting these errors cleared up is a reasonable first goal in working with selinux, I wonder if someone would point out to me the difference between scontext and tcontext and make just one little light bulb come on here. I've been rtfm'ing for a while here and must be looking right at it, but it's not getting through.
Mark
--
I took a course in speed reading and was able to read War and Peace in twenty minutes. It's about Russia.
-- Woody Allen
Quoted 4 lines
--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Date: Mon, 19 Feb 2001 12:19:09 -0600
From: Mark Slagell <[email protected]>
[ . . . ] I wonder if someone would point out to me the difference between scontext and tcontext and make just one little light bulb come on here. I've been rtfm'ing for a while here and must be looking right at it, but it's not getting through.
Jen's explained it nicely already, but you'll find the usage "ssid", "tsid", "scontext", etc., described starting around p. 7 in the paper by Loscocco and Smalley:
doc/kernel/slinux.{pdf,ps} or
doc/kernel/slinux/index.html
There's a companion paper by Smalley and Fraser about the policy configuration:
doc/policy/policy.{pdf,ps} or
doc/policy/policy/index.html
Signature · 9 lines
Bede McCall <[email protected]> MITRE Corporation 202 Burlington Road Bedford, Massachusetts 01730-1420 -- You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
As others have mentioned, scontext is an abbreviation for source security context, tcontext is an abbreviation for target security context, and tclass is an abbreviation for target security class. Each permission check is based on a pair of security contexts and a security class. Typically, the source security context corresponds to a subject (a process) and the target security context corresponds to an object. However, some permissions are subject-to-subject in order to control operations such as signal delivery, and some permissions are object-to-object in order to control inter-object relationships such as the relationship between a mount point directory and the mounted directory.
Quoted 4 lines
avc: denied { kill } for pid=14271 exe=/usr/sbin/identd capability=5
scontext=system_u:system_r:inetd_child_t tcontext=system_u:system_r:inetd_child_t tclass=capability
We have not yet defined a separate domain for the IDENT daemon, so it currently runs in the generic domain "inetd_child_t" used for descendants of inetd that do not have their own individual domains. You can find the domain definition for inetd_child_t in policy/domains/system/inetd.te. If you want to allow identd to run on your system, you can either define a new domain for it with the appropriate permissions or you can add
this permission to the inetd_child_t domain, e.g.
allow inetd_child_t self:capability kill;
Quoted 5 lines
avc: denied { append } for pid=27031 exe=/usr/sbin/crond path=/var/log/cron dev=03:01 ino=99291
scontext=system_u:system_r:crond_t tcontext=system_u:object_r:xfs_tmp_t tclass=file
This message indicates that your /var/log/cron file is incorrectly labeled with the xfs_tmp_t type. It should be labeled with the cron_log_t type. This might have happened if you booted your system with an ordinary Linux kernel after initially installing SELinux, because the file may have been recreated while running the ordinary Linux kernel. In that case, its label would not be set properly. To be safe, you should run 'rm -f relabel; make relabel' in your policy directory as root in the sysadm_r role and sysadm_t domain. This will reset all of your file security contexts to the expected values. You can also individually set a particular file's security context by using the chcon program, e.g.
chcon system_u:object_r:cron_log_t /var/log/cron
--
Stephen D. Smalley, NAI Labs
[email protected]
--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 5 lines · Stephen Smalley
As others have mentioned, scontext is an abbreviation for source security context, tcontext is an abbreviation for target security context, and tclass is an abbreviation for target security class.
...
Thanks to everyone for the helpful replies. Lesson #1: RTFM is most helpful when you're reading the _right_ FM. :-) Whoops. So I have that now, and things are beginning to make sense.
Quoted 6 lines
... your
/var/log/cronfile is incorrectly
labeled with thexfs_tmp_ttype. It should be labeled with thecron_log_ttype. This might have happened if you booted your system with an ordinary Linux kernel after initially installing SELinux, because the file may have been recreated while running the ordinary Linux kernel.
Bullseye. In fact we installed selinux here with the agreement that the machine be dual-boot into modified and unmodified modes. I'll have to make sure it stays in the SE kernel.
-- Mark
--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.