]> err.no Git - linux-2.6/blobdiff - include/linux/security.h
fix up ext2_fs.h for userspace after reservations backport
[linux-2.6] / include / linux / security.h
index df591d289ec98e18aec72af323c2cb941c560236..ac050830a873b044ba1d23144c88fb99a975c934 100644 (file)
 #include <linux/xfrm.h>
 #include <net/flow.h>
 
+/*
+ * Bounding set
+ */
+extern kernel_cap_t cap_bset;
+
+extern unsigned securebits;
+
 struct ctl_table;
 
 /*
@@ -825,9 +832,11 @@ struct request_sock;
  *     incoming sk_buff @skb has been associated with a particular socket, @sk.
  *     @sk contains the sock (not socket) associated with the incoming sk_buff.
  *     @skb contains the incoming network data.
- * @socket_getpeersec:
+ * @socket_getpeersec_stream:
  *     This hook allows the security module to provide peer socket security
- *     state to userspace via getsockopt SO_GETPEERSEC.
+ *     state for unix or connected tcp sockets to userspace via getsockopt
+ *     SO_GETPEERSEC.  For tcp sockets this can be meaningful if the
+ *     socket is associated with an ipsec SA.
  *     @sock is the local socket.
  *     @optval userspace memory where the security state is to be copied.
  *     @optlen userspace int where the module should copy the actual length
@@ -836,6 +845,17 @@ struct request_sock;
  *     by the caller.
  *     Return 0 if all is well, otherwise, typical getsockopt return
  *     values.
+ * @socket_getpeersec_dgram:
+ *     This hook allows the security module to provide peer socket security
+ *     state for udp sockets on a per-packet basis to userspace via
+ *     getsockopt SO_GETPEERSEC.  The application must first have indicated
+ *     the IP_PASSSEC option via getsockopt.  It can then retrieve the
+ *     security state returned by this hook for a packet via the SCM_SECURITY
+ *     ancillary message type.
+ *     @skb is the skbuff for the packet being queried
+ *     @secdata is a pointer to a buffer in which to copy the security data
+ *     @seclen is the maximum length for @secdata
+ *     Return 0 on success, error on failure.
  * @sk_alloc_security:
  *      Allocate and attach a security structure to the sk->sk_security field,
  *      which is used to copy security attributes between local stream sockets.
@@ -1158,10 +1178,6 @@ struct request_sock;
  *     allow module stacking.
  *     @name contains the name of the security module being stacked.
  *     @ops contains a pointer to the struct security_operations of the module to stack.
- * @unregister_security:
- *     remove a stacked module.
- *     @name contains the name of the security module being unstacked.
- *     @ops contains a pointer to the struct security_operations of the module to unstack.
  * 
  * @secid_to_secctx:
  *     Convert secid to security context.
@@ -1259,7 +1275,6 @@ struct security_operations {
        int (*inode_removexattr) (struct dentry *dentry, char *name);
        int (*inode_need_killpriv) (struct dentry *dentry);
        int (*inode_killpriv) (struct dentry *dentry);
-       const char *(*inode_xattr_getsuffix) (void);
        int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err);
        int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags);
        int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size);
@@ -1350,8 +1365,6 @@ struct security_operations {
        /* allow module stacking */
        int (*register_security) (const char *name,
                                  struct security_operations *ops);
-       int (*unregister_security) (const char *name,
-                                   struct security_operations *ops);
 
        void (*d_instantiate) (struct dentry *dentry, struct inode *inode);
 
@@ -1432,9 +1445,7 @@ struct security_operations {
 /* prototypes */
 extern int security_init       (void);
 extern int register_security   (struct security_operations *ops);
-extern int unregister_security (struct security_operations *ops);
 extern int mod_reg_security    (const char *name, struct security_operations *ops);
-extern int mod_unreg_security  (const char *name, struct security_operations *ops);
 extern struct dentry *securityfs_create_file(const char *name, mode_t mode,
                                             struct dentry *parent, void *data,
                                             const struct file_operations *fops);
@@ -1518,7 +1529,6 @@ int security_inode_listxattr(struct dentry *dentry);
 int security_inode_removexattr(struct dentry *dentry, char *name);
 int security_inode_need_killpriv(struct dentry *dentry);
 int security_inode_killpriv(struct dentry *dentry);
-const char *security_inode_xattr_getsuffix(void);
 int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err);
 int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags);
 int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size);
@@ -1923,11 +1933,6 @@ static inline int security_inode_killpriv(struct dentry *dentry)
        return cap_inode_killpriv(dentry);
 }
 
-static inline const char *security_inode_xattr_getsuffix (void)
-{
-       return NULL ;
-}
-
 static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err)
 {
        return -EOPNOTSUPP;