Skip to contentSkip to conversation

security_task_getsecid and selinux_get_task_sid

DISCUSSION Casey Schaufler 2 participants 5 messages Aug 1, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

Is there any difference between calls to security_task_getsecid() and selinux_get_task_sid() with selinux installed? It doesn't look like there is, but I could be missing something.

Thank you.

Casey Schaufler
[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.

#1 lore raw
Quoted 3 lines · Casey Schaufler

Is there any difference between calls to security_task_getsecid() and selinux_get_task_sid() with selinux installed? It doesn't look like there is, but I could be missing something.

No, there is known duplication between the direct SELinux exports and certain LSM hooks, a consequence of audit going one direction and labeled networking going the other. On our todo list for cleanup unless you get to it first. Same thing applies for e.g. security_secid_to_secctx vs. selinux_sid_to_string.

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.
#2 lore raw
Quoted 10 lines · --- Stephen Smalley
Quoted 3 lines · Casey Schaufler

Is there any difference between calls to security_task_getsecid() and selinux_get_task_sid() with selinux installed? It doesn't look like there is, but I could be missing something.

No, there is known duplication between the direct SELinux exports and certain LSM hooks, a consequence of audit going one direction and labeled networking going the other. On our todo list for cleanup unless you get to it first. Same thing applies for e.g. security_secid_to_secctx vs. selinux_sid_to_string.

OK, thank you.

On a related note, selinux_get_inode_sid() has no LSM equivilent. This isn't surprising, but it's one of the interfaces I need to address for my own nefarious purposes. Which would you prefer:

security_inode_getsecid()
security_inode_sid()
security_get_inode_sid()

I would lean toward security_inode_getsecid() because of the existing security_task_getsecid(), but as it's your code I'm mucking with I wouldn't want to impose my taste without asking.

Thank you again.

Casey Schaufler
[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.

#3 lore raw
Quoted 19 lines · Casey Schaufler
Quoted 10 lines · --- Stephen Smalley
Quoted 3 lines · Casey Schaufler

Is there any difference between calls to security_task_getsecid() and selinux_get_task_sid() with selinux installed? It doesn't look like there is, but I could be missing something.

No, there is known duplication between the direct SELinux exports and certain LSM hooks, a consequence of audit going one direction and labeled networking going the other. On our todo list for cleanup unless you get to it first. Same thing applies for e.g. security_secid_to_secctx vs. selinux_sid_to_string.

OK, thank you.

On a related note, selinux_get_inode_sid() has no LSM equivilent. This isn't surprising, but it's one of the interfaces I need to address for my own nefarious purposes. Which would you prefer:

Quoted 7 lines

security_inode_getsecid()
security_inode_sid()
security_get_inode_sid()

I would lean toward security_inode_getsecid() because of the existing security_task_getsecid(), but as it's your code I'm mucking with I wouldn't want to impose my taste without asking.

See patch 1/7 in the labeled NFS series.

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.
#4 lore raw
Quoted 24 lines · --- Stephen Smalley
Quoted 23 lines · Casey Schaufler
Quoted 10 lines · --- Stephen Smalley
Quoted 3 lines · Casey Schaufler

Is there any difference between calls to security_task_getsecid() and selinux_get_task_sid() with selinux installed? It doesn't look like there is, but I could be missing something.

No, there is known duplication between the direct SELinux exports and certain LSM hooks, a consequence of audit going one direction and labeled networking going the other. On our todo list for cleanup unless you get to it first. Same thing applies for e.g. security_secid_to_secctx vs. selinux_sid_to_string.

OK, thank you.

On a related note, selinux_get_inode_sid() has no LSM equivilent. This isn't surprising, but it's one of the interfaces I need to address for my own nefarious purposes. Which would you prefer:

security_inode_getsecid()
security_inode_sid()
security_get_inode_sid()

Quoted 5 lines
Quoted 3 lines

I would lean toward security_inode_getsecid() because of the existing security_task_getsecid(), but as it's your code I'm mucking with I wouldn't want to impose my taste without asking.

See patch 1/7 in the labeled NFS series.

security_inode_getsecid() it is then.

Casey Schaufler
[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.