Security Enhanced Linux
What's New
Frequently Asked Questions
Background
Documents
License
Download
Participating
Mail List
Archives
Remaining Work
Contributors
Related Work
Press Releases
Information Assurance Research
NIARL In-house Research Areas
Mathematical Sciences Program
Sabbaticals
Computer & Information Sciences Research
Technology Transfer
Advanced Computing
Advanced Mathematics
Communications & Networking
Information Processing
Microelectronics
Other Technologies
Technology Fact Sheets
Publications
Related Links
|
SELinux Mailing ListRe: Issue on getting security context of socket and message
From: Stephen Smalley <sds_at_epoch.ncsc.mil>
Date: Tue, 09 Nov 2004 10:39:21 -0500
In the kernel, you can obtain the security context of a socket via the security field of its associated inode. Look at socket_has_perm() and selinux_socket_sock_rcv_skb() in security/selinux/hooks.c for examples. Unix domain sockets can also use the sk_security field in the struct sock for security state (e.g. peer SID), but INET sockets cannot safely do so at present. Remember that most of the LSM networking security fields and hooks were rejected by the mainline kernel, so only limited support exists in the current SELinux and there is no message labeling at all. Since sys_security was rejected by the mainline kernel, the extended socket API of SELinux is not presently supported; we will ultimately have to revisit it in the future when we have better motivating examples of real applications that use it. While fgetfilecon()->fgetxattr() could conceivably export the security context of a local socket, that would require implementing a fake xattr handler for the socket code; alternative would be to implement it via getsockopt(). There is a getpeercon(3) function in libselinux that allows you to get the context of a peer for a Unix domain stream socket; this is internally implemented via getsockopt(). -- Stephen Smalley <sds@epoch.ncsc.mil> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with the words "unsubscribe selinux" without quotes as the message.Received on Tue 9 Nov 2004 - 10:43:21 EST |
|
Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009 |