diff options
Diffstat (limited to 'include/linux/security.h')
-rw-r--r-- | include/linux/security.h | 32 |
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, | |||
77 | extern int cap_task_setscheduler(struct task_struct *p); | 77 | extern int cap_task_setscheduler(struct task_struct *p); |
78 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); | 78 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); |
79 | extern int cap_task_setnice(struct task_struct *p, int nice); | 79 | extern int cap_task_setnice(struct task_struct *p, int nice); |
80 | extern int cap_syslog(int type, bool from_file); | ||
81 | extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); | 80 | extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); |
82 | 81 | ||
83 | struct msghdr; | 82 | struct 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); | |||
1671 | int security_sysctl(struct ctl_table *table, int op); | 1669 | int security_sysctl(struct ctl_table *table, int op); |
1672 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1670 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
1673 | int security_quota_on(struct dentry *dentry); | 1671 | int security_quota_on(struct dentry *dentry); |
1674 | int security_syslog(int type, bool from_file); | 1672 | int security_syslog(int type); |
1675 | int security_settime(struct timespec *ts, struct timezone *tz); | 1673 | int security_settime(struct timespec *ts, struct timezone *tz); |
1676 | int security_vm_enough_memory(long pages); | 1674 | int security_vm_enough_memory(long pages); |
1677 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); | 1675 | int 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, | |||
1714 | int security_inode_readlink(struct dentry *dentry); | 1712 | int security_inode_readlink(struct dentry *dentry); |
1715 | int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); | 1713 | int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); |
1716 | int security_inode_permission(struct inode *inode, int mask); | 1714 | int security_inode_permission(struct inode *inode, int mask); |
1715 | int security_inode_exec_permission(struct inode *inode, unsigned int flags); | ||
1717 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); | 1716 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); |
1718 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); | 1717 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); |
1719 | int security_inode_setxattr(struct dentry *dentry, const char *name, | 1718 | int 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 | ||
1904 | static inline int security_syslog(int type, bool from_file) | 1903 | static inline int security_syslog(int type) |
1905 | { | 1904 | { |
1906 | return cap_syslog(type, from_file); | 1905 | return 0; |
1907 | } | 1906 | } |
1908 | 1907 | ||
1909 | static inline int security_settime(struct timespec *ts, struct timezone *tz) | 1908 | static 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 | ||
2105 | static inline int security_inode_exec_permission(struct inode *inode, | ||
2106 | unsigned int flags) | ||
2107 | { | ||
2108 | return 0; | ||
2109 | } | ||
2110 | |||
2106 | static inline int security_inode_setattr(struct dentry *dentry, | 2111 | static 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 | ||
2529 | int security_unix_stream_connect(struct socket *sock, struct socket *other, | 2534 | int security_unix_stream_connect(struct sock *sock, struct sock *other, struct sock *newsk); |
2530 | struct sock *newsk); | ||
2531 | int security_unix_may_send(struct socket *sock, struct socket *other); | 2535 | int security_unix_may_send(struct socket *sock, struct socket *other); |
2532 | int security_socket_create(int family, int type, int protocol, int kern); | 2536 | int security_socket_create(int family, int type, int protocol, int kern); |
2533 | int security_socket_post_create(struct socket *sock, int family, | 2537 | int security_socket_post_create(struct socket *sock, int family, |
@@ -2568,8 +2572,8 @@ void security_tun_dev_post_create(struct sock *sk); | |||
2568 | int security_tun_dev_attach(struct sock *sk); | 2572 | int security_tun_dev_attach(struct sock *sk); |
2569 | 2573 | ||
2570 | #else /* CONFIG_SECURITY_NETWORK */ | 2574 | #else /* CONFIG_SECURITY_NETWORK */ |
2571 | static inline int security_unix_stream_connect(struct socket *sock, | 2575 | static 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; |