aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index b8246a8df7d2..1ac42475ea08 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -77,7 +77,6 @@ extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
77extern int cap_task_setscheduler(struct task_struct *p); 77extern int cap_task_setscheduler(struct task_struct *p);
78extern int cap_task_setioprio(struct task_struct *p, int ioprio); 78extern int cap_task_setioprio(struct task_struct *p, int ioprio);
79extern int cap_task_setnice(struct task_struct *p, int nice); 79extern int cap_task_setnice(struct task_struct *p, int nice);
80extern int cap_syslog(int type, bool from_file);
81extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); 80extern int cap_vm_enough_memory(struct mm_struct *mm, long pages);
82 81
83struct msghdr; 82struct msghdr;
@@ -458,7 +457,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
458 * called when the actual read/write operations are performed. 457 * called when the actual read/write operations are performed.
459 * @inode contains the inode structure to check. 458 * @inode contains the inode structure to check.
460 * @mask contains the permission mask. 459 * @mask contains the permission mask.
461 * @nd contains the nameidata (may be NULL).
462 * Return 0 if permission is granted. 460 * Return 0 if permission is granted.
463 * @inode_setattr: 461 * @inode_setattr:
464 * Check permission before setting file attributes. Note that the kernel 462 * Check permission before setting file attributes. Note that the kernel
@@ -797,8 +795,9 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
797 * @unix_stream_connect: 795 * @unix_stream_connect:
798 * Check permissions before establishing a Unix domain stream connection 796 * Check permissions before establishing a Unix domain stream connection
799 * between @sock and @other. 797 * between @sock and @other.
800 * @sock contains the socket structure. 798 * @sock contains the sock structure.
801 * @other contains the peer socket structure. 799 * @other contains the peer sock structure.
800 * @newsk contains the new sock structure.
802 * Return 0 if permission is granted. 801 * Return 0 if permission is granted.
803 * @unix_may_send: 802 * @unix_may_send:
804 * Check permissions before connecting or sending datagrams from @sock to 803 * Check permissions before connecting or sending datagrams from @sock to
@@ -1388,7 +1387,7 @@ struct security_operations {
1388 int (*sysctl) (struct ctl_table *table, int op); 1387 int (*sysctl) (struct ctl_table *table, int op);
1389 int (*quotactl) (int cmds, int type, int id, struct super_block *sb); 1388 int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
1390 int (*quota_on) (struct dentry *dentry); 1389 int (*quota_on) (struct dentry *dentry);
1391 int (*syslog) (int type, bool from_file); 1390 int (*syslog) (int type);
1392 int (*settime) (struct timespec *ts, struct timezone *tz); 1391 int (*settime) (struct timespec *ts, struct timezone *tz);
1393 int (*vm_enough_memory) (struct mm_struct *mm, long pages); 1392 int (*vm_enough_memory) (struct mm_struct *mm, long pages);
1394 1393
@@ -1569,8 +1568,7 @@ struct security_operations {
1569 int (*inode_getsecctx)(struct inode *inode, void **ctx, u32 *ctxlen); 1568 int (*inode_getsecctx)(struct inode *inode, void **ctx, u32 *ctxlen);
1570 1569
1571#ifdef CONFIG_SECURITY_NETWORK 1570#ifdef CONFIG_SECURITY_NETWORK
1572 int (*unix_stream_connect) (struct socket *sock, 1571 int (*unix_stream_connect) (struct sock *sock, struct sock *other, struct sock *newsk);
1573 struct socket *other, struct sock *newsk);
1574 int (*unix_may_send) (struct socket *sock, struct socket *other); 1572 int (*unix_may_send) (struct socket *sock, struct socket *other);
1575 1573
1576 int (*socket_create) (int family, int type, int protocol, int kern); 1574 int (*socket_create) (int family, int type, int protocol, int kern);
@@ -1671,7 +1669,7 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap);
1671int security_sysctl(struct ctl_table *table, int op); 1669int security_sysctl(struct ctl_table *table, int op);
1672int security_quotactl(int cmds, int type, int id, struct super_block *sb); 1670int security_quotactl(int cmds, int type, int id, struct super_block *sb);
1673int security_quota_on(struct dentry *dentry); 1671int security_quota_on(struct dentry *dentry);
1674int security_syslog(int type, bool from_file); 1672int security_syslog(int type);
1675int security_settime(struct timespec *ts, struct timezone *tz); 1673int security_settime(struct timespec *ts, struct timezone *tz);
1676int security_vm_enough_memory(long pages); 1674int security_vm_enough_memory(long pages);
1677int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); 1675int security_vm_enough_memory_mm(struct mm_struct *mm, long pages);
@@ -1714,6 +1712,7 @@ int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry,
1714int security_inode_readlink(struct dentry *dentry); 1712int security_inode_readlink(struct dentry *dentry);
1715int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); 1713int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd);
1716int security_inode_permission(struct inode *inode, int mask); 1714int security_inode_permission(struct inode *inode, int mask);
1715int security_inode_exec_permission(struct inode *inode, unsigned int flags);
1717int security_inode_setattr(struct dentry *dentry, struct iattr *attr); 1716int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
1718int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); 1717int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry);
1719int security_inode_setxattr(struct dentry *dentry, const char *name, 1718int security_inode_setxattr(struct dentry *dentry, const char *name,
@@ -1901,9 +1900,9 @@ static inline int security_quota_on(struct dentry *dentry)
1901 return 0; 1900 return 0;
1902} 1901}
1903 1902
1904static inline int security_syslog(int type, bool from_file) 1903static inline int security_syslog(int type)
1905{ 1904{
1906 return cap_syslog(type, from_file); 1905 return 0;
1907} 1906}
1908 1907
1909static inline int security_settime(struct timespec *ts, struct timezone *tz) 1908static inline int security_settime(struct timespec *ts, struct timezone *tz)
@@ -2103,6 +2102,12 @@ static inline int security_inode_permission(struct inode *inode, int mask)
2103 return 0; 2102 return 0;
2104} 2103}
2105 2104
2105static inline int security_inode_exec_permission(struct inode *inode,
2106 unsigned int flags)
2107{
2108 return 0;
2109}
2110
2106static inline int security_inode_setattr(struct dentry *dentry, 2111static inline int security_inode_setattr(struct dentry *dentry,
2107 struct iattr *attr) 2112 struct iattr *attr)
2108{ 2113{
@@ -2526,8 +2531,7 @@ static inline int security_inode_getsecctx(struct inode *inode, void **ctx, u32
2526 2531
2527#ifdef CONFIG_SECURITY_NETWORK 2532#ifdef CONFIG_SECURITY_NETWORK
2528 2533
2529int security_unix_stream_connect(struct socket *sock, struct socket *other, 2534int security_unix_stream_connect(struct sock *sock, struct sock *other, struct sock *newsk);
2530 struct sock *newsk);
2531int security_unix_may_send(struct socket *sock, struct socket *other); 2535int security_unix_may_send(struct socket *sock, struct socket *other);
2532int security_socket_create(int family, int type, int protocol, int kern); 2536int security_socket_create(int family, int type, int protocol, int kern);
2533int security_socket_post_create(struct socket *sock, int family, 2537int security_socket_post_create(struct socket *sock, int family,
@@ -2568,8 +2572,8 @@ void security_tun_dev_post_create(struct sock *sk);
2568int security_tun_dev_attach(struct sock *sk); 2572int security_tun_dev_attach(struct sock *sk);
2569 2573
2570#else /* CONFIG_SECURITY_NETWORK */ 2574#else /* CONFIG_SECURITY_NETWORK */
2571static inline int security_unix_stream_connect(struct socket *sock, 2575static inline int security_unix_stream_connect(struct sock *sock,
2572 struct socket *other, 2576 struct sock *other,
2573 struct sock *newsk) 2577 struct sock *newsk)
2574{ 2578{
2575 return 0; 2579 return 0;