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 | |
| parent | fdc81f45e9f57858da6351836507fbcf1b7583ee (diff) | |
| parent | 01e97e6517053d7c0b9af5248e944a9209909cf5 (diff) | |
Merge branch 'for-davem' into for-next
Diffstat (limited to 'security')
| -rw-r--r-- | security/capability.c | 6 | ||||
| -rw-r--r-- | security/security.c | 5 | ||||
| -rw-r--r-- | security/selinux/hooks.c | 35 | ||||
| -rw-r--r-- | security/selinux/selinuxfs.c | 2 | ||||
| -rw-r--r-- | security/smack/smack_netfilter.c | 8 |
5 files changed, 12 insertions, 44 deletions
diff --git a/security/capability.c b/security/capability.c index bdf22034a961..0d03fcc489a4 100644 --- a/security/capability.c +++ b/security/capability.c | |||
| @@ -776,11 +776,6 @@ static int cap_tun_dev_open(void *security) | |||
| 776 | { | 776 | { |
| 777 | return 0; | 777 | return 0; |
| 778 | } | 778 | } |
| 779 | |||
| 780 | static void cap_skb_owned_by(struct sk_buff *skb, struct sock *sk) | ||
| 781 | { | ||
| 782 | } | ||
| 783 | |||
| 784 | #endif /* CONFIG_SECURITY_NETWORK */ | 779 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 785 | 780 | ||
| 786 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 781 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| @@ -1134,7 +1129,6 @@ void __init security_fixup_ops(struct security_operations *ops) | |||
| 1134 | set_to_cap_if_null(ops, tun_dev_open); | 1129 | set_to_cap_if_null(ops, tun_dev_open); |
| 1135 | set_to_cap_if_null(ops, tun_dev_attach_queue); | 1130 | set_to_cap_if_null(ops, tun_dev_attach_queue); |
| 1136 | set_to_cap_if_null(ops, tun_dev_attach); | 1131 | set_to_cap_if_null(ops, tun_dev_attach); |
| 1137 | set_to_cap_if_null(ops, skb_owned_by); | ||
| 1138 | #endif /* CONFIG_SECURITY_NETWORK */ | 1132 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 1139 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1133 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| 1140 | set_to_cap_if_null(ops, xfrm_policy_alloc_security); | 1134 | set_to_cap_if_null(ops, xfrm_policy_alloc_security); |
diff --git a/security/security.c b/security/security.c index ed890c6d31c5..730ac65a5737 100644 --- a/security/security.c +++ b/security/security.c | |||
| @@ -1359,11 +1359,6 @@ int security_tun_dev_open(void *security) | |||
| 1359 | } | 1359 | } |
| 1360 | EXPORT_SYMBOL(security_tun_dev_open); | 1360 | EXPORT_SYMBOL(security_tun_dev_open); |
| 1361 | 1361 | ||
| 1362 | void security_skb_owned_by(struct sk_buff *skb, struct sock *sk) | ||
| 1363 | { | ||
| 1364 | security_ops->skb_owned_by(skb, sk); | ||
| 1365 | } | ||
| 1366 | |||
| 1367 | #endif /* CONFIG_SECURITY_NETWORK */ | 1362 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 1368 | 1363 | ||
| 1369 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1364 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
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, |
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 1684bcc78b34..5fde34326dcf 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
| @@ -152,7 +152,7 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf, | |||
| 152 | goto out; | 152 | goto out; |
| 153 | 153 | ||
| 154 | /* No partial writes. */ | 154 | /* No partial writes. */ |
| 155 | length = EINVAL; | 155 | length = -EINVAL; |
| 156 | if (*ppos != 0) | 156 | if (*ppos != 0) |
| 157 | goto out; | 157 | goto out; |
| 158 | 158 | ||
diff --git a/security/smack/smack_netfilter.c b/security/smack/smack_netfilter.c index c952632afb0d..a455cfc9ec1f 100644 --- a/security/smack/smack_netfilter.c +++ b/security/smack/smack_netfilter.c | |||
| @@ -23,9 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | static unsigned int smack_ipv6_output(const struct nf_hook_ops *ops, | 24 | static unsigned int smack_ipv6_output(const struct nf_hook_ops *ops, |
| 25 | struct sk_buff *skb, | 25 | struct sk_buff *skb, |
| 26 | const struct net_device *in, | 26 | const struct nf_hook_state *state) |
| 27 | const struct net_device *out, | ||
| 28 | int (*okfn)(struct sk_buff *)) | ||
| 29 | { | 27 | { |
| 30 | struct socket_smack *ssp; | 28 | struct socket_smack *ssp; |
| 31 | struct smack_known *skp; | 29 | struct smack_known *skp; |
| @@ -42,9 +40,7 @@ static unsigned int smack_ipv6_output(const struct nf_hook_ops *ops, | |||
| 42 | 40 | ||
| 43 | static unsigned int smack_ipv4_output(const struct nf_hook_ops *ops, | 41 | static unsigned int smack_ipv4_output(const struct nf_hook_ops *ops, |
| 44 | struct sk_buff *skb, | 42 | struct sk_buff *skb, |
| 45 | const struct net_device *in, | 43 | const struct nf_hook_state *state) |
| 46 | const struct net_device *out, | ||
| 47 | int (*okfn)(struct sk_buff *)) | ||
| 48 | { | 44 | { |
| 49 | struct socket_smack *ssp; | 45 | struct socket_smack *ssp; |
| 50 | struct smack_known *skp; | 46 | struct smack_known *skp; |
