Skip to contentSkip to conversation

Process Transition

DISCUSSION [email protected] 3 participants 4 messages May 14, 2003 – May 15, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

I am having an issue with policy configuration. On a default install of redhat, I compiled and installed the selinux kernel and associated tools. I've probably spent about 5 hours familiarizing myself with the policy language and the logic of type enforcement. I browsed through the archive for a bit, and didn't find a clear solution to my issue.

Upon booting the LSM kernel in permissive mode, I get many access denied messages as the init process runs (as well as some other processes that run at boot). I am sure that once I have an understanding as to why one of these occur, I should be able to rectify the remaining problems, so I will post the first denied process transition.

avc: denied { transition } for pid=1 comm=swapper path=/sbin/init / dev=08 :01 ino=229436 scontext=system_u:system_r:kernel_t / tcontext=system_u:system_r:init_t tclass=process

I have the following line in the policy.conf (post make install-src install, of course):

allow kernel_t init_t:process transition;

In Frank Mayer's post about domain transitions,

http://www.nsa.gov/selinux/list-archive/3984.html

he states that program entry and program execute rules are also required. I have the following rules:

allow init_t init_exec_t:file entrypoint;
allow init_t init_exec_t:file { read getattr lock execute ioctl };

Obviously, what I have is not sufficient (or perhaps wrong/irrelevant). What else is required to allow the transition to occur? I realize this a developer's list, not a help-me spam list, but I haven't found any other good sources.

Please advise me if this is inappropriate and where else I might look for some assistance.

Much thanks,

Jared

--
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 8 lines

avc: denied { transition } for pid=1 comm=swapper path=/sbin/init / dev=08 :01 ino=229436 scontext=system_u:system_r:kernel_t / tcontext=system_u:system_r:init_t tclass=process

I have the following line in the policy.conf (post make install-src install, of course):

allow kernel_t init_t:process transition;

The deny audit message seems to indicate that the above rule is indeed *not* in the running policy??? Are you sure? Perhaps there's a problem with role allow and/or user definitions, but I thought they just indicated an invalid context.

Quoted 10 lines

In Frank Mayer's post about domain transitions,

http://www.nsa.gov/selinux/list-archive/3984.html

he states that program entry and program execute rules are also required. I have the following rules:

allow init_t init_exec_t:file entrypoint;
allow init_t init_exec_t:file { read getattr lock execute ioctl };

I think you have a slight misunderstanding. For a domain transition:

1. OLD domain has "file execute" access to entry type (i.e., init_exec_t)
2. NEW domain has "file entrypoint" access to entry type.

in addition to the process transition permission above.

Frank

--
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 [email protected]
Quoted 8 lines

avc: denied { transition } for pid=1 comm=swapper path=/sbin/init / dev=08 :01 ino=229436 scontext=system_u:system_r:kernel_t / tcontext=system_u:system_r:init_t tclass=process

I have the following line in the policy.conf (post make install-src install, of course):

allow kernel_t init_t:process transition;

The deny audit message seems to indicate that the above rule is indeed *not* in the running policy??? Are you sure? Perhaps there's a problem with role allow and/or user definitions, but I thought they just indicated an invalid context not a transition permission denied.

Quoted 10 lines

In Frank Mayer's post about domain transitions,

http://www.nsa.gov/selinux/list-archive/3984.html

he states that program entry and program execute rules are also required. I have the following rules:

allow init_t init_exec_t:file entrypoint;
allow init_t init_exec_t:file { read getattr lock execute ioctl };

I think you have a slight misunderstanding. For a domain transition:

1. OLD domain has "file execute" access to entry type (i.e., init_exec_t)
2. NEW domain has "file entrypoint" access to entry type.

in addition to the process transition permission above.

Frank

--
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 [email protected]
Quoted 3 lines · On Wed, 2003-05-14 at 16:06, [email protected] wrote:

Upon booting the LSM kernel in permissive mode, I get many access denied messages as the init process runs (as well as some other processes that run at boot).

Which LSM kernel are you using? The one from the NSA SELinux web site? Or the sourceforge CVS tree? Or Russell Coker or Brian May's packages for Debian? Or from the public LSM BitKeeper trees?

Does your "LSM kernel" also include the separate SELinux-specific patch? Does lsm-2.4/init/main.c include the call to selinux_init()?

Quoted 8 lines

avc: denied { transition } for pid=1 comm=swapper path=/sbin/init / dev=08 :01 ino=229436 scontext=system_u:system_r:kernel_t / tcontext=system_u:system_r:init_t tclass=process

I have the following line in the policy.conf (post make install-src install, of course):

allow kernel_t init_t:process transition;

I don't see why this permission would fail, given that the above rule is included. There is no change in user identity or role on this transition, so neither the constraints nor the role allow rules are relevant, just the TE rule.

Make sure that your binary policy corresponds to your policy.conf, i.e. recompile it with checkpolicy. You can also run checkpolicy -d -b on the binary policy file and query it to see whether a given permission is included in 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.