Skip to contentSkip to conversation

Invalid context in targeted SELinux policy

DISCUSSION Daniel Musgrave 4 participants 5 messages Aug 15, 2006 – Aug 16, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

I am in the process of writing an application and associated policy in Centos 4.3, running a targeted SELinux environment at version 1.17.30-2.126. After succesfully creating the necessary rules in my .te file, and the associated file contexts in the .fc file, I am attempting to resolve one last problem. After compiling my policy and running the application, I get the following error:

audit(...): security_compute_sid: invalid context root:system_r:upgrade_t for scontext=root:system_r:unconfined_t tcontext=system_u:object_r:upgrade_exec_t tclass=process

The domain for this executable is 'upgrade' and the file context of the binary is 'upgrade_exec_t' (there are some associated *_log_t and *_tmp_t files as well). The .te file defines upgrade using the application_domain macro.

I have thus far been unable to find any sort of documentation or discussion that relates to this specific problem (most file_context issues seem to come from improperly-formatted .fc files during labeling, rather than at runtime). Am I forgetting to include some line in my .te file? Do I need to include the new domain/type I've created in some other location? Any insight you can provide would be greatly appreciated.

Thanks,

Daniel

PS - here is my .fc file, in case my problem somehow *does* involve it.

upgrade.fc

# upgrade
/usr/bin/upgrade      --  system_u:object_r:upgrade_exec_t
/var/log/upgrade.log  --  system_u:object_r:upgrade_log_t
/tmp/upgrade(/.*)?    --  system_u:object_r:upgrade_tmp_t

--
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 6 lines · Daniel Musgrave

I am in the process of writing an application and associated policy in Centos 4.3, running a targeted SELinux environment at version 1.17.30-2.126. After succesfully creating the necessary rules in my .te file, and the associated file contexts in the .fc file, I am attempting to resolve one last problem. After compiling my policy and running the application, I get the following error:

audit(...): security_compute_sid: invalid context root:system_r:upgrade_t for scontext=root:system_r:unconfined_t tcontext=system_u:object_r:upgrade_exec_t tclass=process

The domain for this executable is 'upgrade' and the file context of the binary is 'upgrade_exec_t' (there are some associated *_log_t and *_tmp_t files as well). The .te file defines upgrade using the application_domain macro.

Did you authorize your type for the system_r role?

role system_r upgrade_t;

Karl

--
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
Quoted 11 lines · Karl MacMillan
Quoted 6 lines · Daniel Musgrave

I am in the process of writing an application and associated policy in Centos 4.3, running a targeted SELinux environment at version 1.17.30-2.126. After succesfully creating the necessary rules in my .te file, and the associated file contexts in the .fc file, I am attempting to resolve one last problem. After compiling my policy and running the application, I get the following error:

audit(...): security_compute_sid: invalid context root:system_r:upgrade_t for scontext=root:system_r:unconfined_t tcontext=system_u:object_r:upgrade_exec_t tclass=process

The domain for this executable is 'upgrade' and the file context of the binary is 'upgrade_exec_t' (there are some associated *_log_t and *_tmp_t files as well). The .te file defines upgrade using the application_domain macro.

Did you authorize your type for the system_r role?

role system_r upgrade_t;

I shouldn't answer emails in the morning:

role system_r types upgrade_t;

Karl

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

#3 lore raw
In reply to Karl MacMillan

Hi,

Quoted 1 line

role system_r upgrade_t;

You're missing the "types" keyword.

The sxid.te file is missing a

role system_r types sxid_t;

btw. Not committed to the Debian policy yet, maybe tonight.

best regards,
Erich Schubert

Signature · 11 lines
   erich@(vitavonni.de|debian.org)    --    GPG Key ID: 4B3A135C    (o_
     Which is worse: ignorance or apathy? Who knows? Who cares?     //\
    Eine Stadt ist einem erst wirklich vertraut wenn man Freunde    V_/_
              in ihr hat. --- Antoine de Saint-Exupéry



--
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.
#4 lore raw
In reply to Daniel Musgrave
Quoted 10 lines · Daniel Musgrave

I am in the process of writing an application and associated policy in Centos 4.3, running a targeted SELinux environment at version 1.17.30-2.126. After succesfully creating the necessary rules in my .te file, and the associated file contexts in the .fc file, I am attempting to resolve one last problem. After compiling my policy and running the application, I get the following error:

audit(...): security_compute_sid: invalid context root:system_r:upgrade_t for scontext=root:system_r:unconfined_t tcontext=system_u:object_r:upgrade_exec_t tclass=process

This typically means that the new domain 'upgrade_t' hasn't been authorized for the role 'system_r', e.g. role system_r types upgrade_t;

Quoted 4 lines

The domain for this executable is 'upgrade' and the file context of the binary is 'upgrade_exec_t' (there are some associated *_log_t and *_tmp_t files as well). The .te file defines upgrade using the application_domain macro.

Hmm...application_domain() includes a role statement for sysadm_r by default, and also includes a role statement for system_r if targeted_policy is defined, i.e. building targeted policy. At least in the last release of the example policy. But possibly that wasn't in the CentOS/RHEL policies as shipped.

Signature · 8 lines
Stephen Smalley
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.