Skip to contentSkip to conversation

invalid contaxt

DISCUSSION Russell Coker 2 participants 3 messages Mar 6, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

I am running SE Linux in debugging mode as I have not yet got the policies working properly.

When I load a new policy I get the following message in syslog:

Mar  6 19:18:05 lyta kernel: security:  context 

system_u:system_r:sysadm_ssh_t is invalid

Here is how I try and find the cause of the message:

root@lyta:/etc/flask# list_sids |grep sysadm_ssh_t
SID 256 -> Scontext  system_u:system_r:sysadm_ssh_t
root@lyta:/etc/flask# ps ax --secsid  | grep 256
13654    248 grep 256
root@lyta:/etc/flask#

So it seems that I have not process using SID 256!

What am I doing wrong?

Signature · 9 lines
If you send email to me or to a mailing list that I use which has >4 lines
of legalistic junk at the end then you are specifically authorizing me to do
whatever I wish with the message and all other messages from your domain, by
posting the message you agree that your long legalistic sig is void.

--
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.
#1 lore raw
Quoted 11 lines · Russell Coker

When I load a new policy I get the following message in syslog:

Mar  6 19:18:05 lyta kernel: security:  context

system_u:system_r:sysadm_ssh_t is invalid

Here is how I try and find the cause of the message:

root@lyta:/etc/flask# list_sids |grep sysadm_ssh_t
SID 256 -> Scontext  system_u:system_r:sysadm_ssh_t
root@lyta:/etc/flask# ps ax --secsid  | grep 256
13654    248 grep 256
root@lyta:/etc/flask#
Quoted 3 lines

So it seems that I have not process using SID 256!

What am I doing wrong?

Look for a message in the log of the form:
security_compute_sid: invalid context %s for scontext=%s tcontext=%s tclass=%s

When in permissive mode, the kernel will log such a message but permit the SID to be created anyway. Then, on subsequent policy reloads, you'll get another warning about the context (as in your message) being invalid.

sysadm_ssh_t is a domain entered when a sysadm_t process runs the ssh program. The example policy only authorizes the sysadm_r role for this domain, since ssh is typically run from a user session whose user identity and role have been set by login (or sshd). If you ran ssh from a single-user shell or you aren't using a modified login/sshd, then you'll still have the system_u:system_r user identity and role, so you'll get this error.

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

#2 lore raw
Quoted 10 lines · Stephen Smalley
Quoted 1 line

What am I doing wrong?

Look for a message in the log of the form:
security_compute_sid: invalid context %s for scontext=%s tcontext=%s
tclass=%s

When in permissive mode, the kernel will log such a message but permit the SID to be created anyway. Then, on subsequent policy reloads, you'll get another warning about the context (as in your message) being invalid.

Quoted 7 lines

sysadm_ssh_t is a domain entered when a sysadm_t process runs the ssh program. The example policy only authorizes the sysadm_r role for this domain, since ssh is typically run from a user session whose user identity and role have been set by login (or sshd). If you ran ssh from a single-user shell or you aren't using a modified login/sshd, then you'll still have the system_u:system_r user identity and role, so you'll get this error.

Thanks for that. The log messages made it clear what was going wrong.

I have inetd binding some ports to localhost and running ssh to forward connections to my server.

I'll change my sysadm_r appropriately.

Signature · 9 lines
If you send email to me or to a mailing list that I use which has >4 lines
of legalistic junk at the end then you are specifically authorizing me to do
whatever I wish with the message and all other messages from your domain, by
posting the message you agree that your long legalistic sig is void.

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