aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-10 21:11:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-10 21:11:41 -0500
commit2df4ee78d042ee3d17cbebd51e31b300286549dc (patch)
tree7c723c99569e1f1a81490d7b31e5d6af27b6d169 /security/selinux/hooks.c
parent3419b45039c6b799c974a8019361c045e7ca232c (diff)
parent8a921265e2cd31e61a0c2eda582af54c5bfef897 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix null deref in xt_TEE netfilter module, from Eric Dumazet. 2) Several spots need to get to the original listner for SYN-ACK packets, most spots got this ok but some were not. Whilst covering the remaining cases, create a helper to do this. From Eric Dumazet. 3) Missiing check of return value from alloc_netdev() in CAIF SPI code, from Rasmus Villemoes. 4) Don't sleep while != TASK_RUNNING in macvtap, from Vlad Yasevich. 5) Use after free in mvneta driver, from Justin Maggard. 6) Fix race on dst->flags access in dst_release(), from Eric Dumazet. 7) Add missing ZLIB_INFLATE dependency for new qed driver. From Arnd Bergmann. 8) Fix multicast getsockopt deadlock, from WANG Cong. 9) Fix deadlock in btusb, from Kuba Pawlak. 10) Some ipv6_add_dev() failure paths were not cleaning up the SNMP6 counter state. From Sabrina Dubroca. 11) Fix packet_bind() race, which can cause lost notifications, from Francesco Ruggeri. 12) Fix MAC restoration in qlcnic driver during bonding mode changes, from Jarod Wilson. 13) Revert bridging forward delay change which broke libvirt and other userspace things, from Vlad Yasevich. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (65 commits) Revert "bridge: Allow forward delay to be cfgd when STP enabled" bpf_trace: Make dependent on PERF_EVENTS qed: select ZLIB_INFLATE net: fix a race in dst_release() net: mvneta: Fix memory use after free. net: Documentation: Fix default value tcp_limit_output_bytes macvtap: Resolve possible __might_sleep warning in macvtap_do_read() mvneta: add FIXED_PHY dependency net: caif: check return value of alloc_netdev net: hisilicon: NET_VENDOR_HISILICON should depend on HAS_DMA drivers: net: xgene: fix RGMII 10/100Mb mode netfilter: nft_meta: use skb_to_full_sk() helper net_sched: em_meta: use skb_to_full_sk() helper sched: cls_flow: use skb_to_full_sk() helper netfilter: xt_owner: use skb_to_full_sk() helper smack: use skb_to_full_sk() helper net: add skb_to_full_sk() helper and use it in selinux_netlbl_skbuff_setsid() bpf: doc: correct arch list for supported eBPF JIT dwc_eth_qos: Delete an unnecessary check before the function call "of_node_put" bonding: fix panic on non-ARPHRD_ETHER enslave failure ...
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 9e591e5989be..d0cfaa9f19d0 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4933,7 +4933,7 @@ static unsigned int selinux_ip_postroute_compat(struct sk_buff *skb,
4933 int ifindex, 4933 int ifindex,
4934 u16 family) 4934 u16 family)
4935{ 4935{
4936 struct sock *sk = skb->sk; 4936 struct sock *sk = skb_to_full_sk(skb);
4937 struct sk_security_struct *sksec; 4937 struct sk_security_struct *sksec;
4938 struct common_audit_data ad; 4938 struct common_audit_data ad;
4939 struct lsm_network_audit net = {0,}; 4939 struct lsm_network_audit net = {0,};
@@ -4988,7 +4988,7 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb,
4988 if (!secmark_active && !peerlbl_active) 4988 if (!secmark_active && !peerlbl_active)
4989 return NF_ACCEPT; 4989 return NF_ACCEPT;
4990 4990
4991 sk = skb->sk; 4991 sk = skb_to_full_sk(skb);
4992 4992
4993#ifdef CONFIG_XFRM 4993#ifdef CONFIG_XFRM
4994 /* If skb->dst->xfrm is non-NULL then the packet is undergoing an IPsec 4994 /* If skb->dst->xfrm is non-NULL then the packet is undergoing an IPsec
@@ -5033,8 +5033,6 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb,
5033 u32 skb_sid; 5033 u32 skb_sid;
5034 struct sk_security_struct *sksec; 5034 struct sk_security_struct *sksec;
5035 5035
5036 if (sk->sk_state == TCP_NEW_SYN_RECV)
5037 sk = inet_reqsk(sk)->rsk_listener;
5038 sksec = sk->sk_security; 5036 sksec = sk->sk_security;
5039 if (selinux_skb_peerlbl_sid(skb, family, &skb_sid)) 5037 if (selinux_skb_peerlbl_sid(skb, family, &skb_sid))
5040 return NF_DROP; 5038 return NF_DROP;