diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-11 22:27:19 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-11 22:27:19 -0400 |
commit | 39c853ebfe169f187a760b34f9cbf54751bfce00 (patch) | |
tree | 2a5a741d0cff7d4f90998b31b32ff80cfccd0369 /security/selinux/hooks.c | |
parent | fdc81f45e9f57858da6351836507fbcf1b7583ee (diff) | |
parent | 01e97e6517053d7c0b9af5248e944a9209909cf5 (diff) |
Merge branch 'for-davem' into for-next
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index e119cdcffc87..c318b304ee2f 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -51,7 +51,6 @@ | |||
51 | #include <linux/tty.h> | 51 | #include <linux/tty.h> |
52 | #include <net/icmp.h> | 52 | #include <net/icmp.h> |
53 | #include <net/ip.h> /* for local_port_range[] */ | 53 | #include <net/ip.h> /* for local_port_range[] */ |
54 | #include <net/sock.h> | ||
55 | #include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */ | 54 | #include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */ |
56 | #include <net/inet_connection_sock.h> | 55 | #include <net/inet_connection_sock.h> |
57 | #include <net/net_namespace.h> | 56 | #include <net/net_namespace.h> |
@@ -4646,11 +4645,6 @@ static void selinux_inet_conn_established(struct sock *sk, struct sk_buff *skb) | |||
4646 | selinux_skb_peerlbl_sid(skb, family, &sksec->peer_sid); | 4645 | selinux_skb_peerlbl_sid(skb, family, &sksec->peer_sid); |
4647 | } | 4646 | } |
4648 | 4647 | ||
4649 | static void selinux_skb_owned_by(struct sk_buff *skb, struct sock *sk) | ||
4650 | { | ||
4651 | skb_set_owner_w(skb, sk); | ||
4652 | } | ||
4653 | |||
4654 | static int selinux_secmark_relabel_packet(u32 sid) | 4648 | static int selinux_secmark_relabel_packet(u32 sid) |
4655 | { | 4649 | { |
4656 | const struct task_security_struct *__tsec; | 4650 | const struct task_security_struct *__tsec; |
@@ -4852,21 +4846,17 @@ static unsigned int selinux_ip_forward(struct sk_buff *skb, | |||
4852 | 4846 | ||
4853 | static unsigned int selinux_ipv4_forward(const struct nf_hook_ops *ops, | 4847 | static unsigned int selinux_ipv4_forward(const struct nf_hook_ops *ops, |
4854 | struct sk_buff *skb, | 4848 | struct sk_buff *skb, |
4855 | const struct net_device *in, | 4849 | const struct nf_hook_state *state) |
4856 | const struct net_device *out, | ||
4857 | int (*okfn)(struct sk_buff *)) | ||
4858 | { | 4850 | { |
4859 | return selinux_ip_forward(skb, in, PF_INET); | 4851 | return selinux_ip_forward(skb, state->in, PF_INET); |
4860 | } | 4852 | } |
4861 | 4853 | ||
4862 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 4854 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
4863 | static unsigned int selinux_ipv6_forward(const struct nf_hook_ops *ops, | 4855 | static unsigned int selinux_ipv6_forward(const struct nf_hook_ops *ops, |
4864 | struct sk_buff *skb, | 4856 | struct sk_buff *skb, |
4865 | const struct net_device *in, | 4857 | const struct nf_hook_state *state) |
4866 | const struct net_device *out, | ||
4867 | int (*okfn)(struct sk_buff *)) | ||
4868 | { | 4858 | { |
4869 | return selinux_ip_forward(skb, in, PF_INET6); | 4859 | return selinux_ip_forward(skb, state->in, PF_INET6); |
4870 | } | 4860 | } |
4871 | #endif /* IPV6 */ | 4861 | #endif /* IPV6 */ |
4872 | 4862 | ||
@@ -4914,9 +4904,7 @@ static unsigned int selinux_ip_output(struct sk_buff *skb, | |||
4914 | 4904 | ||
4915 | static unsigned int selinux_ipv4_output(const struct nf_hook_ops *ops, | 4905 | static unsigned int selinux_ipv4_output(const struct nf_hook_ops *ops, |
4916 | struct sk_buff *skb, | 4906 | struct sk_buff *skb, |
4917 | const struct net_device *in, | 4907 | const struct nf_hook_state *state) |
4918 | const struct net_device *out, | ||
4919 | int (*okfn)(struct sk_buff *)) | ||
4920 | { | 4908 | { |
4921 | return selinux_ip_output(skb, PF_INET); | 4909 | return selinux_ip_output(skb, PF_INET); |
4922 | } | 4910 | } |
@@ -5091,21 +5079,17 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, | |||
5091 | 5079 | ||
5092 | static unsigned int selinux_ipv4_postroute(const struct nf_hook_ops *ops, | 5080 | static unsigned int selinux_ipv4_postroute(const struct nf_hook_ops *ops, |
5093 | struct sk_buff *skb, | 5081 | struct sk_buff *skb, |
5094 | const struct net_device *in, | 5082 | const struct nf_hook_state *state) |
5095 | const struct net_device *out, | ||
5096 | int (*okfn)(struct sk_buff *)) | ||
5097 | { | 5083 | { |
5098 | return selinux_ip_postroute(skb, out, PF_INET); | 5084 | return selinux_ip_postroute(skb, state->out, PF_INET); |
5099 | } | 5085 | } |
5100 | 5086 | ||
5101 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 5087 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
5102 | static unsigned int selinux_ipv6_postroute(const struct nf_hook_ops *ops, | 5088 | static unsigned int selinux_ipv6_postroute(const struct nf_hook_ops *ops, |
5103 | struct sk_buff *skb, | 5089 | struct sk_buff *skb, |
5104 | const struct net_device *in, | 5090 | const struct nf_hook_state *state) |
5105 | const struct net_device *out, | ||
5106 | int (*okfn)(struct sk_buff *)) | ||
5107 | { | 5091 | { |
5108 | return selinux_ip_postroute(skb, out, PF_INET6); | 5092 | return selinux_ip_postroute(skb, state->out, PF_INET6); |
5109 | } | 5093 | } |
5110 | #endif /* IPV6 */ | 5094 | #endif /* IPV6 */ |
5111 | 5095 | ||
@@ -6035,7 +6019,6 @@ static struct security_operations selinux_ops = { | |||
6035 | .tun_dev_attach_queue = selinux_tun_dev_attach_queue, | 6019 | .tun_dev_attach_queue = selinux_tun_dev_attach_queue, |
6036 | .tun_dev_attach = selinux_tun_dev_attach, | 6020 | .tun_dev_attach = selinux_tun_dev_attach, |
6037 | .tun_dev_open = selinux_tun_dev_open, | 6021 | .tun_dev_open = selinux_tun_dev_open, |
6038 | .skb_owned_by = selinux_skb_owned_by, | ||
6039 | 6022 | ||
6040 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 6023 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
6041 | .xfrm_policy_alloc_security = selinux_xfrm_policy_alloc, | 6024 | .xfrm_policy_alloc_security = selinux_xfrm_policy_alloc, |