オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Annotation of /trunk/1.5.x/ccs-patch/include/linux/tomoyo.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 244 - (hide annotations) (download) (as text)
Mon May 28 11:49:47 2007 UTC (16 years, 11 months ago) by kumaneko
Original Path: trunk/ccs-patch/include/linux/tomoyo.h
File MIME type: text/x-chdr
File size: 9888 byte(s)


1 kumaneko 111 /*
2     * include/linux/tomoyo.h
3     *
4     * Implementation of the Domain-Based Mandatory Access Control.
5     *
6     * Copyright (C) 2005-2007 NTT DATA CORPORATION
7     *
8 kumaneko 240 * Version: 1.4.1-rc2 2007/05/25
9 kumaneko 111 *
10     * This file is applicable to both 2.4.30 and 2.6.11 and later.
11     * See README.ccs for ChangeLog.
12     *
13     */
14     /*
15     * A brief description about TOMOYO:
16     *
17     * TOMOYO stands for "Task Oriented Management Obviates Your Onus".
18     * TOMOYO is intended to provide the Domain-Based MAC utilizing task_struct.
19     *
20     * The biggest feature of TOMOYO is that TOMOYO has "accept mode".
21     * The accept mode can automatically generate policy definition,
22     * and dramatically reduces the policy definition labors.
23     *
24     * TOMOYO is applicable to figuring out the system's behavior, for
25     * TOMOYO uses the canonicalized absolute pathnames and TreeView style domain transitions.
26     */
27    
28     #ifndef _LINUX_TOMOYO_H
29     #define _LINUX_TOMOYO_H
30    
31     #ifndef __user
32     #define __user
33     #endif
34    
35     /***** TOMOYO Linux start. *****/
36    
37     struct path_info;
38    
39     #ifdef CONFIG_TOMOYO_MAC_FOR_FILE
40     /* Check whether the given filename is allowed to read/write/execute. */
41     int CheckFilePerm(const char *filename, const u8 perm, const char *operation);
42     int CheckExecPerm(const struct path_info *filename, struct file *filp);
43     /* Check whether the given dentry is allowed to read/write/execute. */
44     int CheckOpenPermission(struct dentry *dentry, struct vfsmount *mnt, const int flag);
45     /* Check whether the given dentry is allowed to write. */
46     int CheckSingleWritePermission(const unsigned int operation, struct dentry *dentry, struct vfsmount *mnt);
47     int CheckDoubleWritePermission(const unsigned int operation, struct dentry *dentry1, struct vfsmount *mnt1, struct dentry *dentry2, struct vfsmount *mnt2);
48     int CheckReWritePermission(struct file *filp);
49     #else
50     static inline int CheckFilePerm(const char *filename, const u8 perm, const char *operation) { return 0; }
51     static inline int CheckExecPerm(const struct path_info *filename, struct file *filp) { return 0; }
52     static inline int CheckOpenPermission(struct dentry *dentry, struct vfsmount *mnt, const int flag) { return 0; }
53     static inline int CheckSingleWritePermission(const unsigned int operation, struct dentry *dentry, struct vfsmount *mnt) { return 0; }
54     static inline int CheckDoubleWritePermission(const unsigned int operation, struct dentry *dentry1, struct vfsmount *mnt1, struct dentry *dentry2, struct vfsmount *mnt2) { return 0; }
55     static inline int CheckReWritePermission(struct file *filp) { return 0; }
56     #endif
57    
58     #ifdef CONFIG_TOMOYO_MAC_FOR_ARGV0
59     /* Check whether the basename of program and argv0 is allowed to differ. */
60     int CheckArgv0Perm(const struct path_info *filename, const char *argv0);
61     #else
62     static inline int CheckArgv0Perm(const struct path_info *filename, const char *argv0) { return 0; }
63     #endif
64    
65     /* Check whether the given IP address and port number are allowed to use. */
66     #ifdef CONFIG_TOMOYO_MAC_FOR_NETWORK
67     int CheckNetworkListenACL(const int is_ipv6, const u8 *address, const u16 port);
68     int CheckNetworkConnectACL(const int is_ipv6, const int sock_type, const u8 *address, const u16 port);
69     int CheckNetworkBindACL(const int is_ipv6, const int sock_type, const u8 *address, const u16 port);
70     int CheckNetworkAcceptACL(const int is_ipv6, const u8 *address, const u16 port);
71     int CheckNetworkSendMsgACL(const int is_ipv6, const int sock_type, const u8 *address, const u16 port);
72     int CheckNetworkRecvMsgACL(const int is_ipv6, const int sock_type, const u8 *address, const u16 port);
73     #else
74     static inline int CheckNetworkListenACL(const int is_ipv6, const u8 *address, const u16 port) { return 0; }
75     static inline int CheckNetworkConnectACL(const int is_ipv6, const int sock_type, const u8 *address, const u16 port) { return 0; }
76     static inline int CheckNetworkBindACL(const int is_ipv6, const int sock_type, const u8 *address, const u16 port) { return 0; }
77     static inline int CheckNetworkAcceptACL(const int is_ipv6, const u8 *address, const u16 port) { return 0; }
78     static inline int CheckNetworkSendMsgACL(const int is_ipv6, const int sock_type, const u8 *address, const u16 port) { return 0; }
79     static inline int CheckNetworkRecvMsgACL(const int is_ipv6, const int sock_type, const u8 *address, const u16 port) { return 0; }
80     #endif
81    
82     /* Check whether the given signal is allowed to use. */
83     #ifdef CONFIG_TOMOYO_MAC_FOR_SIGNAL
84     int CheckSignalACL(const int sig, const int pid);
85     #else
86     static inline int CheckSignalACL(const int sig, const int pid) { return 0; }
87     #endif
88    
89     /* Check whether the given capability is allowed to use. */
90     #ifdef CONFIG_TOMOYO_MAC_FOR_CAPABILITY
91     int CheckCapabilityACL(const unsigned int capability);
92     #else
93     static inline int CheckCapabilityACL(const unsigned int capability) { return 0; }
94     #endif
95    
96     struct inode;
97     #include <linux/version.h>
98     #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
99     int pre_vfs_mknod(struct inode *dir, struct dentry *dentry);
100     #else
101     int pre_vfs_mknod(struct inode *dir, struct dentry *dentry, int mode);
102     #endif
103    
104     /************************* Index numbers for Access Controls. *************************/
105    
106     #define TYPE_CREATE_ACL 0
107     #define TYPE_UNLINK_ACL 1
108     #define TYPE_MKDIR_ACL 2
109     #define TYPE_RMDIR_ACL 3
110     #define TYPE_MKFIFO_ACL 4
111     #define TYPE_MKSOCK_ACL 5
112     #define TYPE_MKBLOCK_ACL 6
113     #define TYPE_MKCHAR_ACL 7
114     #define TYPE_TRUNCATE_ACL 8
115     #define TYPE_SYMLINK_ACL 9
116     #define TYPE_LINK_ACL 10
117     #define TYPE_RENAME_ACL 11
118     #define TYPE_REWRITE_ACL 12
119    
120     #define TYPE_FILE_ACL 100
121     #define TYPE_ARGV0_ACL 101
122     #define TYPE_CAPABILITY_ACL 102
123     #define TYPE_IP_NETWORK_ACL 103
124 kumaneko 115 #define TYPE_SIGNAL_ACL 104
125 kumaneko 111
126     /************************* Index numbers for Capability Controls. *************************/
127    
128     #define TOMOYO_INET_STREAM_SOCKET_CREATE 0 /* socket(PF_INET or PF_INET6, SOCK_STREAM, *) */
129     #define TOMOYO_INET_STREAM_SOCKET_LISTEN 1 /* listen() for PF_INET or PF_INET6, SOCK_STREAM */
130     #define TOMOYO_INET_STREAM_SOCKET_CONNECT 2 /* connect() for PF_INET or PF_INET6, SOCK_STREAM */
131     #define TOMOYO_USE_INET_DGRAM_SOCKET 3 /* socket(PF_INET or PF_INET6, SOCK_DGRAM, *) */
132     #define TOMOYO_USE_INET_RAW_SOCKET 4 /* socket(PF_INET or PF_INET6, SOCK_RAW, *) */
133     #define TOMOYO_USE_ROUTE_SOCKET 5 /* socket(PF_ROUTE, *, *) */
134     #define TOMOYO_USE_PACKET_SOCKET 6 /* socket(PF_PACKET, *, *) */
135     #define TOMOYO_SYS_MOUNT 7 /* sys_mount() */
136     #define TOMOYO_SYS_UMOUNT 8 /* sys_umount() */
137     #define TOMOYO_SYS_REBOOT 9 /* sys_reboot() */
138     #define TOMOYO_SYS_CHROOT 10 /* sys_chroot() */
139     #define TOMOYO_SYS_KILL 11 /* sys_kill(), sys_tkill(), sys_tgkill() */
140     #define TOMOYO_SYS_VHANGUP 12 /* sys_vhangup() */
141     #define TOMOYO_SYS_SETTIME 13 /* do_settimeofday(), sys_adjtimex() */
142     #define TOMOYO_SYS_NICE 14 /* sys_nice(), sys_setpriority() */
143     #define TOMOYO_SYS_SETHOSTNAME 15 /* sys_sethostname(), sys_setdomainname() */
144     #define TOMOYO_USE_KERNEL_MODULE 16 /* sys_create_module(), sys_init_module(), sys_delete_module() */
145     #define TOMOYO_CREATE_FIFO 17 /* sys_mknod(S_IFIFO) */
146     #define TOMOYO_CREATE_BLOCK_DEV 18 /* sys_mknod(S_IFBLK) */
147     #define TOMOYO_CREATE_CHAR_DEV 19 /* sys_mknod(S_IFCHR) */
148     #define TOMOYO_CREATE_UNIX_SOCKET 20 /* sys_mknod(S_IFSOCK) */
149     #define TOMOYO_SYS_LINK 21 /* sys_link() */
150     #define TOMOYO_SYS_SYMLINK 22 /* sys_symlink() */
151     #define TOMOYO_SYS_RENAME 23 /* sys_rename() */
152     #define TOMOYO_SYS_UNLINK 24 /* sys_unlink() */
153     #define TOMOYO_SYS_CHMOD 25 /* sys_chmod(), sys_fchmod() */
154     #define TOMOYO_SYS_CHOWN 26 /* sys_chown(), sys_fchown(), sys_lchown() */
155     #define TOMOYO_SYS_IOCTL 27 /* sys_ioctl(), compat_sys_ioctl() */
156     #define TOMOYO_SYS_KEXEC_LOAD 28 /* sys_kexec_load() */
157 kumaneko 141 #define TOMOYO_SYS_PIVOT_ROOT 29 /* sys_pivot_root() */
158     #define TOMOYO_MAX_CAPABILITY_INDEX 30
159 kumaneko 111
160     /************************* Index numbers for Network Controls. *************************/
161    
162     #define NETWORK_ACL_UDP_BIND 0
163     #define NETWORK_ACL_UDP_CONNECT 1
164     #define NETWORK_ACL_TCP_BIND 2
165     #define NETWORK_ACL_TCP_LISTEN 3
166     #define NETWORK_ACL_TCP_CONNECT 4
167     #define NETWORK_ACL_TCP_ACCEPT 5
168     #define NETWORK_ACL_RAW_BIND 6
169     #define NETWORK_ACL_RAW_CONNECT 7
170    
171 kumaneko 115 struct linux_binprm;
172     struct pt_regs;
173     int search_binary_handler_with_transition(struct linux_binprm *bprm, struct pt_regs *regs);
174    
175     #define TOMOYO_CHECK_READ_FOR_OPEN_EXEC 1
176    
177 kumaneko 111 /***** TOMOYO Linux end. *****/
178     #endif

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26