Path: blob/master/security/selinux/include/objsec.h
10817 views
/*1* NSA Security-Enhanced Linux (SELinux) security module2*3* This file contains the SELinux security data structures for kernel objects.4*5* Author(s): Stephen Smalley, <[email protected]>6* Chris Vance, <[email protected]>7* Wayne Salamon, <[email protected]>8* James Morris <[email protected]>9*10* Copyright (C) 2001,2002 Networks Associates Technology, Inc.11* Copyright (C) 2003 Red Hat, Inc., James Morris <[email protected]>12*13* This program is free software; you can redistribute it and/or modify14* it under the terms of the GNU General Public License version 2,15* as published by the Free Software Foundation.16*/17#ifndef _SELINUX_OBJSEC_H_18#define _SELINUX_OBJSEC_H_1920#include <linux/list.h>21#include <linux/sched.h>22#include <linux/fs.h>23#include <linux/binfmts.h>24#include <linux/in.h>25#include <linux/spinlock.h>26#include "flask.h"27#include "avc.h"2829struct task_security_struct {30u32 osid; /* SID prior to last execve */31u32 sid; /* current SID */32u32 exec_sid; /* exec SID */33u32 create_sid; /* fscreate SID */34u32 keycreate_sid; /* keycreate SID */35u32 sockcreate_sid; /* fscreate SID */36};3738struct inode_security_struct {39struct inode *inode; /* back pointer to inode object */40struct list_head list; /* list of inode_security_struct */41u32 task_sid; /* SID of creating task */42u32 sid; /* SID of this object */43u16 sclass; /* security class of this object */44unsigned char initialized; /* initialization flag */45struct mutex lock;46};4748struct file_security_struct {49u32 sid; /* SID of open file description */50u32 fown_sid; /* SID of file owner (for SIGIO) */51u32 isid; /* SID of inode at the time of file open */52u32 pseqno; /* Policy seqno at the time of file open */53};5455struct superblock_security_struct {56struct super_block *sb; /* back pointer to sb object */57u32 sid; /* SID of file system superblock */58u32 def_sid; /* default SID for labeling */59u32 mntpoint_sid; /* SECURITY_FS_USE_MNTPOINT context for files */60unsigned int behavior; /* labeling behavior */61unsigned char flags; /* which mount options were specified */62struct mutex lock;63struct list_head isec_head;64spinlock_t isec_lock;65};6667struct msg_security_struct {68u32 sid; /* SID of message */69};7071struct ipc_security_struct {72u16 sclass; /* security class of this object */73u32 sid; /* SID of IPC resource */74};7576struct netif_security_struct {77int ifindex; /* device index */78u32 sid; /* SID for this interface */79};8081struct netnode_security_struct {82union {83__be32 ipv4; /* IPv4 node address */84struct in6_addr ipv6; /* IPv6 node address */85} addr;86u32 sid; /* SID for this node */87u16 family; /* address family */88};8990struct netport_security_struct {91u32 sid; /* SID for this node */92u16 port; /* port number */93u8 protocol; /* transport protocol */94};9596struct sk_security_struct {97#ifdef CONFIG_NETLABEL98enum { /* NetLabel state */99NLBL_UNSET = 0,100NLBL_REQUIRE,101NLBL_LABELED,102NLBL_REQSKB,103NLBL_CONNLABELED,104} nlbl_state;105struct netlbl_lsm_secattr *nlbl_secattr; /* NetLabel sec attributes */106#endif107u32 sid; /* SID of this object */108u32 peer_sid; /* SID of peer */109u16 sclass; /* sock security class */110};111112struct key_security_struct {113u32 sid; /* SID of key */114};115116extern unsigned int selinux_checkreqprot;117118#endif /* _SELINUX_OBJSEC_H_ */119120121