Skip to contentSkip to conversation

do SELinux write/read permission checks exist?

DISCUSSION Michael C Thompson 3 participants 3 messages Nov 22, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

So, I've managed to loose track of this in my mind, but does SELinux do permission checks for sys_read and sys_write?

Thanks,
Mike

--
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 2 lines · Michael C Thompson

So, I've managed to loose track of this in my mind, but does SELinux do permission checks for sys_read and sys_write?

Yes, they are covered by the security_file_permission -> selinux_file_permission hooks. However, for SELinux, those checks are only for revalidation purposes to support revocation upon file relabels or policy changes (and such revocation support is incomplete, e.g. memory-mapped files, in-progress operations).

A check should always be applied when a descriptor is obtained by a process, e.g. the SELinux checking on open (selinux_inode_permission), descriptor inheritance across execve (selinux_bprm_post_apply_creds), and descriptor transfer across local IPC (selinux_file_receive), so that a process can never obtain a descriptor for which it is not authorized.

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
In reply to Michael C Thompson
Quoted 2 lines · Michael C Thompson

So, I've managed to loose track of this in my mind, but does SELinux do permission checks for sys_read and sys_write?

Take a look at vfs_write() and vfs_read() and you will see that they both call the LSM security_file_permission() hook which under SELinux is defined by the selinux_file_permission in security/selinux/hooks.c.

Signature · 7 lines
paul moore
linux security @ hp

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