diff options
Diffstat (limited to 'include/linux/security.h')
| -rw-r--r-- | include/linux/security.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index eee7478cda70..4686491852a7 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -1012,6 +1012,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1012 | * This hook can be used by the module to update any security state | 1012 | * This hook can be used by the module to update any security state |
| 1013 | * associated with the TUN device's security structure. | 1013 | * associated with the TUN device's security structure. |
| 1014 | * @security pointer to the TUN devices's security structure. | 1014 | * @security pointer to the TUN devices's security structure. |
| 1015 | * @skb_owned_by: | ||
| 1016 | * This hook sets the packet's owning sock. | ||
| 1017 | * @skb is the packet. | ||
| 1018 | * @sk the sock which owns the packet. | ||
| 1015 | * | 1019 | * |
| 1016 | * Security hooks for XFRM operations. | 1020 | * Security hooks for XFRM operations. |
| 1017 | * | 1021 | * |
| @@ -1436,7 +1440,7 @@ struct security_operations { | |||
| 1436 | struct path *new_path); | 1440 | struct path *new_path); |
| 1437 | int (*sb_set_mnt_opts) (struct super_block *sb, | 1441 | int (*sb_set_mnt_opts) (struct super_block *sb, |
| 1438 | struct security_mnt_opts *opts); | 1442 | struct security_mnt_opts *opts); |
| 1439 | void (*sb_clone_mnt_opts) (const struct super_block *oldsb, | 1443 | int (*sb_clone_mnt_opts) (const struct super_block *oldsb, |
| 1440 | struct super_block *newsb); | 1444 | struct super_block *newsb); |
| 1441 | int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); | 1445 | int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); |
| 1442 | 1446 | ||
| @@ -1638,6 +1642,7 @@ struct security_operations { | |||
| 1638 | int (*tun_dev_attach_queue) (void *security); | 1642 | int (*tun_dev_attach_queue) (void *security); |
| 1639 | int (*tun_dev_attach) (struct sock *sk, void *security); | 1643 | int (*tun_dev_attach) (struct sock *sk, void *security); |
| 1640 | int (*tun_dev_open) (void *security); | 1644 | int (*tun_dev_open) (void *security); |
| 1645 | void (*skb_owned_by) (struct sk_buff *skb, struct sock *sk); | ||
| 1641 | #endif /* CONFIG_SECURITY_NETWORK */ | 1646 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 1642 | 1647 | ||
| 1643 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1648 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| @@ -1721,7 +1726,7 @@ int security_sb_mount(const char *dev_name, struct path *path, | |||
| 1721 | int security_sb_umount(struct vfsmount *mnt, int flags); | 1726 | int security_sb_umount(struct vfsmount *mnt, int flags); |
| 1722 | int security_sb_pivotroot(struct path *old_path, struct path *new_path); | 1727 | int security_sb_pivotroot(struct path *old_path, struct path *new_path); |
| 1723 | int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); | 1728 | int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); |
| 1724 | void security_sb_clone_mnt_opts(const struct super_block *oldsb, | 1729 | int security_sb_clone_mnt_opts(const struct super_block *oldsb, |
| 1725 | struct super_block *newsb); | 1730 | struct super_block *newsb); |
| 1726 | int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts); | 1731 | int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts); |
| 1727 | 1732 | ||
| @@ -2011,9 +2016,11 @@ static inline int security_sb_set_mnt_opts(struct super_block *sb, | |||
| 2011 | return 0; | 2016 | return 0; |
| 2012 | } | 2017 | } |
| 2013 | 2018 | ||
| 2014 | static inline void security_sb_clone_mnt_opts(const struct super_block *oldsb, | 2019 | static inline int security_sb_clone_mnt_opts(const struct super_block *oldsb, |
| 2015 | struct super_block *newsb) | 2020 | struct super_block *newsb) |
| 2016 | { } | 2021 | { |
| 2022 | return 0; | ||
| 2023 | } | ||
| 2017 | 2024 | ||
| 2018 | static inline int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts) | 2025 | static inline int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts) |
| 2019 | { | 2026 | { |
| @@ -2588,6 +2595,8 @@ int security_tun_dev_attach_queue(void *security); | |||
| 2588 | int security_tun_dev_attach(struct sock *sk, void *security); | 2595 | int security_tun_dev_attach(struct sock *sk, void *security); |
| 2589 | int security_tun_dev_open(void *security); | 2596 | int security_tun_dev_open(void *security); |
| 2590 | 2597 | ||
| 2598 | void security_skb_owned_by(struct sk_buff *skb, struct sock *sk); | ||
| 2599 | |||
| 2591 | #else /* CONFIG_SECURITY_NETWORK */ | 2600 | #else /* CONFIG_SECURITY_NETWORK */ |
| 2592 | static inline int security_unix_stream_connect(struct sock *sock, | 2601 | static inline int security_unix_stream_connect(struct sock *sock, |
| 2593 | struct sock *other, | 2602 | struct sock *other, |
| @@ -2779,6 +2788,11 @@ static inline int security_tun_dev_open(void *security) | |||
| 2779 | { | 2788 | { |
| 2780 | return 0; | 2789 | return 0; |
| 2781 | } | 2790 | } |
| 2791 | |||
| 2792 | static inline void security_skb_owned_by(struct sk_buff *skb, struct sock *sk) | ||
| 2793 | { | ||
| 2794 | } | ||
| 2795 | |||
| 2782 | #endif /* CONFIG_SECURITY_NETWORK */ | 2796 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 2783 | 2797 | ||
| 2784 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 2798 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
