diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-09 01:34:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-09 01:34:53 -0400 |
commit | 38a4671cad3f0d277cf48445b49e42a475ebfb6a (patch) | |
tree | 7348f3dd5f4e1bec39758dcff748a9dcbbf3430c /net | |
parent | d652f7022b359afd5d34fc9fffd71df118521ead (diff) | |
parent | 317ddd256b9c24b0d78fa8018f80f1e495481a10 (diff) |
Merge 3.10-rc5 into char-misc-next
Diffstat (limited to 'net')
32 files changed, 261 insertions, 117 deletions
diff --git a/net/compat.c b/net/compat.c index 79ae88485001..f0a1ba6c8086 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -734,19 +734,25 @@ static unsigned char nas[21] = { | |||
734 | 734 | ||
735 | asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags) | 735 | asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags) |
736 | { | 736 | { |
737 | return sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); | 737 | if (flags & MSG_CMSG_COMPAT) |
738 | return -EINVAL; | ||
739 | return __sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); | ||
738 | } | 740 | } |
739 | 741 | ||
740 | asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg, | 742 | asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg, |
741 | unsigned int vlen, unsigned int flags) | 743 | unsigned int vlen, unsigned int flags) |
742 | { | 744 | { |
745 | if (flags & MSG_CMSG_COMPAT) | ||
746 | return -EINVAL; | ||
743 | return __sys_sendmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, | 747 | return __sys_sendmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, |
744 | flags | MSG_CMSG_COMPAT); | 748 | flags | MSG_CMSG_COMPAT); |
745 | } | 749 | } |
746 | 750 | ||
747 | asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags) | 751 | asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags) |
748 | { | 752 | { |
749 | return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); | 753 | if (flags & MSG_CMSG_COMPAT) |
754 | return -EINVAL; | ||
755 | return __sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); | ||
750 | } | 756 | } |
751 | 757 | ||
752 | asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, unsigned int flags) | 758 | asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, unsigned int flags) |
@@ -768,6 +774,9 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, | |||
768 | int datagrams; | 774 | int datagrams; |
769 | struct timespec ktspec; | 775 | struct timespec ktspec; |
770 | 776 | ||
777 | if (flags & MSG_CMSG_COMPAT) | ||
778 | return -EINVAL; | ||
779 | |||
771 | if (COMPAT_USE_64BIT_TIME) | 780 | if (COMPAT_USE_64BIT_TIME) |
772 | return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, | 781 | return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, |
773 | flags | MSG_CMSG_COMPAT, | 782 | flags | MSG_CMSG_COMPAT, |
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c index c013f38482a1..6cda4e2c2132 100644 --- a/net/core/dev_addr_lists.c +++ b/net/core/dev_addr_lists.c | |||
@@ -39,6 +39,7 @@ static int __hw_addr_create_ex(struct netdev_hw_addr_list *list, | |||
39 | ha->refcount = 1; | 39 | ha->refcount = 1; |
40 | ha->global_use = global; | 40 | ha->global_use = global; |
41 | ha->synced = sync; | 41 | ha->synced = sync; |
42 | ha->sync_cnt = 0; | ||
42 | list_add_tail_rcu(&ha->list, &list->list); | 43 | list_add_tail_rcu(&ha->list, &list->list); |
43 | list->count++; | 44 | list->count++; |
44 | 45 | ||
@@ -66,7 +67,7 @@ static int __hw_addr_add_ex(struct netdev_hw_addr_list *list, | |||
66 | } | 67 | } |
67 | if (sync) { | 68 | if (sync) { |
68 | if (ha->synced) | 69 | if (ha->synced) |
69 | return 0; | 70 | return -EEXIST; |
70 | else | 71 | else |
71 | ha->synced = true; | 72 | ha->synced = true; |
72 | } | 73 | } |
@@ -139,10 +140,13 @@ static int __hw_addr_sync_one(struct netdev_hw_addr_list *to_list, | |||
139 | 140 | ||
140 | err = __hw_addr_add_ex(to_list, ha->addr, addr_len, ha->type, | 141 | err = __hw_addr_add_ex(to_list, ha->addr, addr_len, ha->type, |
141 | false, true); | 142 | false, true); |
142 | if (err) | 143 | if (err && err != -EEXIST) |
143 | return err; | 144 | return err; |
144 | ha->sync_cnt++; | 145 | |
145 | ha->refcount++; | 146 | if (!err) { |
147 | ha->sync_cnt++; | ||
148 | ha->refcount++; | ||
149 | } | ||
146 | 150 | ||
147 | return 0; | 151 | return 0; |
148 | } | 152 | } |
@@ -159,7 +163,8 @@ static void __hw_addr_unsync_one(struct netdev_hw_addr_list *to_list, | |||
159 | if (err) | 163 | if (err) |
160 | return; | 164 | return; |
161 | ha->sync_cnt--; | 165 | ha->sync_cnt--; |
162 | __hw_addr_del_entry(from_list, ha, false, true); | 166 | /* address on from list is not marked synced */ |
167 | __hw_addr_del_entry(from_list, ha, false, false); | ||
163 | } | 168 | } |
164 | 169 | ||
165 | static int __hw_addr_sync_multiple(struct netdev_hw_addr_list *to_list, | 170 | static int __hw_addr_sync_multiple(struct netdev_hw_addr_list *to_list, |
@@ -796,7 +801,7 @@ int dev_mc_sync_multiple(struct net_device *to, struct net_device *from) | |||
796 | return -EINVAL; | 801 | return -EINVAL; |
797 | 802 | ||
798 | netif_addr_lock_nested(to); | 803 | netif_addr_lock_nested(to); |
799 | err = __hw_addr_sync(&to->mc, &from->mc, to->addr_len); | 804 | err = __hw_addr_sync_multiple(&to->mc, &from->mc, to->addr_len); |
800 | if (!err) | 805 | if (!err) |
801 | __dev_set_rx_mode(to); | 806 | __dev_set_rx_mode(to); |
802 | netif_addr_unlock(to); | 807 | netif_addr_unlock(to); |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index af9185d0be6a..cfd777bd6bd0 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -195,7 +195,7 @@ struct sk_buff *__alloc_skb_head(gfp_t gfp_mask, int node) | |||
195 | * the tail pointer in struct sk_buff! | 195 | * the tail pointer in struct sk_buff! |
196 | */ | 196 | */ |
197 | memset(skb, 0, offsetof(struct sk_buff, tail)); | 197 | memset(skb, 0, offsetof(struct sk_buff, tail)); |
198 | skb->data = NULL; | 198 | skb->head = NULL; |
199 | skb->truesize = sizeof(struct sk_buff); | 199 | skb->truesize = sizeof(struct sk_buff); |
200 | atomic_set(&skb->users, 1); | 200 | atomic_set(&skb->users, 1); |
201 | 201 | ||
@@ -611,7 +611,7 @@ static void skb_release_head_state(struct sk_buff *skb) | |||
611 | static void skb_release_all(struct sk_buff *skb) | 611 | static void skb_release_all(struct sk_buff *skb) |
612 | { | 612 | { |
613 | skb_release_head_state(skb); | 613 | skb_release_head_state(skb); |
614 | if (likely(skb->data)) | 614 | if (likely(skb->head)) |
615 | skb_release_data(skb); | 615 | skb_release_data(skb); |
616 | } | 616 | } |
617 | 617 | ||
diff --git a/net/core/sock.c b/net/core/sock.c index 6ba327da79e1..88868a9d21da 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -210,7 +210,7 @@ static const char *const af_family_key_strings[AF_MAX+1] = { | |||
210 | "sk_lock-AF_TIPC" , "sk_lock-AF_BLUETOOTH", "sk_lock-IUCV" , | 210 | "sk_lock-AF_TIPC" , "sk_lock-AF_BLUETOOTH", "sk_lock-IUCV" , |
211 | "sk_lock-AF_RXRPC" , "sk_lock-AF_ISDN" , "sk_lock-AF_PHONET" , | 211 | "sk_lock-AF_RXRPC" , "sk_lock-AF_ISDN" , "sk_lock-AF_PHONET" , |
212 | "sk_lock-AF_IEEE802154", "sk_lock-AF_CAIF" , "sk_lock-AF_ALG" , | 212 | "sk_lock-AF_IEEE802154", "sk_lock-AF_CAIF" , "sk_lock-AF_ALG" , |
213 | "sk_lock-AF_NFC" , "sk_lock-AF_MAX" | 213 | "sk_lock-AF_NFC" , "sk_lock-AF_VSOCK" , "sk_lock-AF_MAX" |
214 | }; | 214 | }; |
215 | static const char *const af_family_slock_key_strings[AF_MAX+1] = { | 215 | static const char *const af_family_slock_key_strings[AF_MAX+1] = { |
216 | "slock-AF_UNSPEC", "slock-AF_UNIX" , "slock-AF_INET" , | 216 | "slock-AF_UNSPEC", "slock-AF_UNIX" , "slock-AF_INET" , |
@@ -226,7 +226,7 @@ static const char *const af_family_slock_key_strings[AF_MAX+1] = { | |||
226 | "slock-AF_TIPC" , "slock-AF_BLUETOOTH", "slock-AF_IUCV" , | 226 | "slock-AF_TIPC" , "slock-AF_BLUETOOTH", "slock-AF_IUCV" , |
227 | "slock-AF_RXRPC" , "slock-AF_ISDN" , "slock-AF_PHONET" , | 227 | "slock-AF_RXRPC" , "slock-AF_ISDN" , "slock-AF_PHONET" , |
228 | "slock-AF_IEEE802154", "slock-AF_CAIF" , "slock-AF_ALG" , | 228 | "slock-AF_IEEE802154", "slock-AF_CAIF" , "slock-AF_ALG" , |
229 | "slock-AF_NFC" , "slock-AF_MAX" | 229 | "slock-AF_NFC" , "slock-AF_VSOCK" ,"slock-AF_MAX" |
230 | }; | 230 | }; |
231 | static const char *const af_family_clock_key_strings[AF_MAX+1] = { | 231 | static const char *const af_family_clock_key_strings[AF_MAX+1] = { |
232 | "clock-AF_UNSPEC", "clock-AF_UNIX" , "clock-AF_INET" , | 232 | "clock-AF_UNSPEC", "clock-AF_UNIX" , "clock-AF_INET" , |
@@ -242,7 +242,7 @@ static const char *const af_family_clock_key_strings[AF_MAX+1] = { | |||
242 | "clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_IUCV" , | 242 | "clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_IUCV" , |
243 | "clock-AF_RXRPC" , "clock-AF_ISDN" , "clock-AF_PHONET" , | 243 | "clock-AF_RXRPC" , "clock-AF_ISDN" , "clock-AF_PHONET" , |
244 | "clock-AF_IEEE802154", "clock-AF_CAIF" , "clock-AF_ALG" , | 244 | "clock-AF_IEEE802154", "clock-AF_CAIF" , "clock-AF_ALG" , |
245 | "clock-AF_NFC" , "clock-AF_MAX" | 245 | "clock-AF_NFC" , "clock-AF_VSOCK" , "clock-AF_MAX" |
246 | }; | 246 | }; |
247 | 247 | ||
248 | /* | 248 | /* |
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index e4147ec1665a..be2f8da0ae8e 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -503,6 +503,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, | |||
503 | 503 | ||
504 | inner_iph = (const struct iphdr *)skb_inner_network_header(skb); | 504 | inner_iph = (const struct iphdr *)skb_inner_network_header(skb); |
505 | 505 | ||
506 | memset(IPCB(skb), 0, sizeof(*IPCB(skb))); | ||
506 | dst = tnl_params->daddr; | 507 | dst = tnl_params->daddr; |
507 | if (dst == 0) { | 508 | if (dst == 0) { |
508 | /* NBMA tunnel */ | 509 | /* NBMA tunnel */ |
@@ -658,7 +659,6 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, | |||
658 | 659 | ||
659 | skb_dst_drop(skb); | 660 | skb_dst_drop(skb); |
660 | skb_dst_set(skb, &rt->dst); | 661 | skb_dst_set(skb, &rt->dst); |
661 | memset(IPCB(skb), 0, sizeof(*IPCB(skb))); | ||
662 | 662 | ||
663 | /* Push down and install the IP header. */ | 663 | /* Push down and install the IP header. */ |
664 | skb_push(skb, sizeof(struct iphdr)); | 664 | skb_push(skb, sizeof(struct iphdr)); |
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index cf08218ddbcf..ff4b781b1056 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -231,8 +231,10 @@ static void ipt_ulog_packet(struct net *net, | |||
231 | put_unaligned(tv.tv_usec, &pm->timestamp_usec); | 231 | put_unaligned(tv.tv_usec, &pm->timestamp_usec); |
232 | put_unaligned(skb->mark, &pm->mark); | 232 | put_unaligned(skb->mark, &pm->mark); |
233 | pm->hook = hooknum; | 233 | pm->hook = hooknum; |
234 | if (prefix != NULL) | 234 | if (prefix != NULL) { |
235 | strncpy(pm->prefix, prefix, sizeof(pm->prefix)); | 235 | strncpy(pm->prefix, prefix, sizeof(pm->prefix) - 1); |
236 | pm->prefix[sizeof(pm->prefix) - 1] = '\0'; | ||
237 | } | ||
236 | else if (loginfo->prefix[0] != '\0') | 238 | else if (loginfo->prefix[0] != '\0') |
237 | strncpy(pm->prefix, loginfo->prefix, sizeof(pm->prefix)); | 239 | strncpy(pm->prefix, loginfo->prefix, sizeof(pm->prefix)); |
238 | else | 240 | else |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 550781a17b34..d35bbf0cf404 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -737,10 +737,15 @@ static void ip_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_buf | |||
737 | { | 737 | { |
738 | struct rtable *rt; | 738 | struct rtable *rt; |
739 | struct flowi4 fl4; | 739 | struct flowi4 fl4; |
740 | const struct iphdr *iph = (const struct iphdr *) skb->data; | ||
741 | int oif = skb->dev->ifindex; | ||
742 | u8 tos = RT_TOS(iph->tos); | ||
743 | u8 prot = iph->protocol; | ||
744 | u32 mark = skb->mark; | ||
740 | 745 | ||
741 | rt = (struct rtable *) dst; | 746 | rt = (struct rtable *) dst; |
742 | 747 | ||
743 | ip_rt_build_flow_key(&fl4, sk, skb); | 748 | __build_flow_key(&fl4, sk, iph, oif, tos, prot, mark, 0); |
744 | __ip_do_redirect(rt, skb, &fl4, true); | 749 | __ip_do_redirect(rt, skb, &fl4, true); |
745 | } | 750 | } |
746 | 751 | ||
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index d1ab6ab29a55..1bbf744c2cc3 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1487,7 +1487,7 @@ static int ipv6_count_addresses(struct inet6_dev *idev) | |||
1487 | } | 1487 | } |
1488 | 1488 | ||
1489 | int ipv6_chk_addr(struct net *net, const struct in6_addr *addr, | 1489 | int ipv6_chk_addr(struct net *net, const struct in6_addr *addr, |
1490 | struct net_device *dev, int strict) | 1490 | const struct net_device *dev, int strict) |
1491 | { | 1491 | { |
1492 | struct inet6_ifaddr *ifp; | 1492 | struct inet6_ifaddr *ifp; |
1493 | unsigned int hash = inet6_addr_hash(addr); | 1493 | unsigned int hash = inet6_addr_hash(addr); |
@@ -2658,8 +2658,10 @@ static void init_loopback(struct net_device *dev) | |||
2658 | sp_rt = addrconf_dst_alloc(idev, &sp_ifa->addr, 0); | 2658 | sp_rt = addrconf_dst_alloc(idev, &sp_ifa->addr, 0); |
2659 | 2659 | ||
2660 | /* Failure cases are ignored */ | 2660 | /* Failure cases are ignored */ |
2661 | if (!IS_ERR(sp_rt)) | 2661 | if (!IS_ERR(sp_rt)) { |
2662 | sp_ifa->rt = sp_rt; | ||
2662 | ip6_ins_rt(sp_rt); | 2663 | ip6_ins_rt(sp_rt); |
2664 | } | ||
2663 | } | 2665 | } |
2664 | read_unlock_bh(&idev->lock); | 2666 | read_unlock_bh(&idev->lock); |
2665 | } | 2667 | } |
diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c index 72836f40b730..95f3f1da0d7f 100644 --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/netfilter.h> | 10 | #include <linux/netfilter.h> |
11 | #include <linux/netfilter_ipv6.h> | 11 | #include <linux/netfilter_ipv6.h> |
12 | #include <linux/export.h> | 12 | #include <linux/export.h> |
13 | #include <net/addrconf.h> | ||
13 | #include <net/dst.h> | 14 | #include <net/dst.h> |
14 | #include <net/ipv6.h> | 15 | #include <net/ipv6.h> |
15 | #include <net/ip6_route.h> | 16 | #include <net/ip6_route.h> |
@@ -186,6 +187,10 @@ static __sum16 nf_ip6_checksum_partial(struct sk_buff *skb, unsigned int hook, | |||
186 | return csum; | 187 | return csum; |
187 | }; | 188 | }; |
188 | 189 | ||
190 | static const struct nf_ipv6_ops ipv6ops = { | ||
191 | .chk_addr = ipv6_chk_addr, | ||
192 | }; | ||
193 | |||
189 | static const struct nf_afinfo nf_ip6_afinfo = { | 194 | static const struct nf_afinfo nf_ip6_afinfo = { |
190 | .family = AF_INET6, | 195 | .family = AF_INET6, |
191 | .checksum = nf_ip6_checksum, | 196 | .checksum = nf_ip6_checksum, |
@@ -198,6 +203,7 @@ static const struct nf_afinfo nf_ip6_afinfo = { | |||
198 | 203 | ||
199 | int __init ipv6_netfilter_init(void) | 204 | int __init ipv6_netfilter_init(void) |
200 | { | 205 | { |
206 | RCU_INIT_POINTER(nf_ipv6_ops, &ipv6ops); | ||
201 | return nf_register_afinfo(&nf_ip6_afinfo); | 207 | return nf_register_afinfo(&nf_ip6_afinfo); |
202 | } | 208 | } |
203 | 209 | ||
@@ -206,5 +212,6 @@ int __init ipv6_netfilter_init(void) | |||
206 | */ | 212 | */ |
207 | void ipv6_netfilter_fini(void) | 213 | void ipv6_netfilter_fini(void) |
208 | { | 214 | { |
215 | RCU_INIT_POINTER(nf_ipv6_ops, NULL); | ||
209 | nf_unregister_afinfo(&nf_ip6_afinfo); | 216 | nf_unregister_afinfo(&nf_ip6_afinfo); |
210 | } | 217 | } |
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index f3c1ff4357ff..51c3285b5d9b 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -90,7 +90,7 @@ static const struct snmp_mib snmp6_ipstats_list[] = { | |||
90 | SNMP_MIB_ITEM("Ip6OutMcastOctets", IPSTATS_MIB_OUTMCASTOCTETS), | 90 | SNMP_MIB_ITEM("Ip6OutMcastOctets", IPSTATS_MIB_OUTMCASTOCTETS), |
91 | SNMP_MIB_ITEM("Ip6InBcastOctets", IPSTATS_MIB_INBCASTOCTETS), | 91 | SNMP_MIB_ITEM("Ip6InBcastOctets", IPSTATS_MIB_INBCASTOCTETS), |
92 | SNMP_MIB_ITEM("Ip6OutBcastOctets", IPSTATS_MIB_OUTBCASTOCTETS), | 92 | SNMP_MIB_ITEM("Ip6OutBcastOctets", IPSTATS_MIB_OUTBCASTOCTETS), |
93 | SNMP_MIB_ITEM("InCsumErrors", IPSTATS_MIB_CSUMERRORS), | 93 | /* IPSTATS_MIB_CSUMERRORS is not relevant in IPv6 (no checksum) */ |
94 | SNMP_MIB_SENTINEL | 94 | SNMP_MIB_SENTINEL |
95 | }; | 95 | }; |
96 | 96 | ||
diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c index 3bb3a891a424..d3cfaf9c7a08 100644 --- a/net/ipv6/udp_offload.c +++ b/net/ipv6/udp_offload.c | |||
@@ -46,11 +46,12 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, | |||
46 | unsigned int mss; | 46 | unsigned int mss; |
47 | unsigned int unfrag_ip6hlen, unfrag_len; | 47 | unsigned int unfrag_ip6hlen, unfrag_len; |
48 | struct frag_hdr *fptr; | 48 | struct frag_hdr *fptr; |
49 | u8 *mac_start, *prevhdr; | 49 | u8 *packet_start, *prevhdr; |
50 | u8 nexthdr; | 50 | u8 nexthdr; |
51 | u8 frag_hdr_sz = sizeof(struct frag_hdr); | 51 | u8 frag_hdr_sz = sizeof(struct frag_hdr); |
52 | int offset; | 52 | int offset; |
53 | __wsum csum; | 53 | __wsum csum; |
54 | int tnl_hlen; | ||
54 | 55 | ||
55 | mss = skb_shinfo(skb)->gso_size; | 56 | mss = skb_shinfo(skb)->gso_size; |
56 | if (unlikely(skb->len <= mss)) | 57 | if (unlikely(skb->len <= mss)) |
@@ -83,9 +84,11 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, | |||
83 | skb->ip_summed = CHECKSUM_NONE; | 84 | skb->ip_summed = CHECKSUM_NONE; |
84 | 85 | ||
85 | /* Check if there is enough headroom to insert fragment header. */ | 86 | /* Check if there is enough headroom to insert fragment header. */ |
86 | if ((skb_mac_header(skb) < skb->head + frag_hdr_sz) && | 87 | tnl_hlen = skb_tnl_header_len(skb); |
87 | pskb_expand_head(skb, frag_hdr_sz, 0, GFP_ATOMIC)) | 88 | if (skb_headroom(skb) < (tnl_hlen + frag_hdr_sz)) { |
88 | goto out; | 89 | if (gso_pskb_expand_head(skb, tnl_hlen + frag_hdr_sz)) |
90 | goto out; | ||
91 | } | ||
89 | 92 | ||
90 | /* Find the unfragmentable header and shift it left by frag_hdr_sz | 93 | /* Find the unfragmentable header and shift it left by frag_hdr_sz |
91 | * bytes to insert fragment header. | 94 | * bytes to insert fragment header. |
@@ -93,11 +96,12 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, | |||
93 | unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr); | 96 | unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr); |
94 | nexthdr = *prevhdr; | 97 | nexthdr = *prevhdr; |
95 | *prevhdr = NEXTHDR_FRAGMENT; | 98 | *prevhdr = NEXTHDR_FRAGMENT; |
96 | unfrag_len = skb_network_header(skb) - skb_mac_header(skb) + | 99 | unfrag_len = (skb_network_header(skb) - skb_mac_header(skb)) + |
97 | unfrag_ip6hlen; | 100 | unfrag_ip6hlen + tnl_hlen; |
98 | mac_start = skb_mac_header(skb); | 101 | packet_start = (u8 *) skb->head + SKB_GSO_CB(skb)->mac_offset; |
99 | memmove(mac_start-frag_hdr_sz, mac_start, unfrag_len); | 102 | memmove(packet_start-frag_hdr_sz, packet_start, unfrag_len); |
100 | 103 | ||
104 | SKB_GSO_CB(skb)->mac_offset -= frag_hdr_sz; | ||
101 | skb->mac_header -= frag_hdr_sz; | 105 | skb->mac_header -= frag_hdr_sz; |
102 | skb->network_header -= frag_hdr_sz; | 106 | skb->network_header -= frag_hdr_sz; |
103 | 107 | ||
diff --git a/net/key/af_key.c b/net/key/af_key.c index 5b1e5af25713..c5fbd7589681 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -2366,6 +2366,8 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, const struct sa | |||
2366 | 2366 | ||
2367 | out: | 2367 | out: |
2368 | xfrm_pol_put(xp); | 2368 | xfrm_pol_put(xp); |
2369 | if (err == 0) | ||
2370 | xfrm_garbage_collect(net); | ||
2369 | return err; | 2371 | return err; |
2370 | } | 2372 | } |
2371 | 2373 | ||
@@ -2615,6 +2617,8 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, const struct sadb_ | |||
2615 | 2617 | ||
2616 | out: | 2618 | out: |
2617 | xfrm_pol_put(xp); | 2619 | xfrm_pol_put(xp); |
2620 | if (delete && err == 0) | ||
2621 | xfrm_garbage_collect(net); | ||
2618 | return err; | 2622 | return err; |
2619 | } | 2623 | } |
2620 | 2624 | ||
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 60f1ce5e5e52..98d20c0f6fed 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -159,9 +159,10 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) | |||
159 | return 0; | 159 | return 0; |
160 | } | 160 | } |
161 | 161 | ||
162 | static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr) | 162 | static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 *addr) |
163 | { | 163 | { |
164 | struct ieee80211_sub_if_data *sdata; | 164 | struct ieee80211_local *local = sdata->local; |
165 | struct ieee80211_sub_if_data *iter; | ||
165 | u64 new, mask, tmp; | 166 | u64 new, mask, tmp; |
166 | u8 *m; | 167 | u8 *m; |
167 | int ret = 0; | 168 | int ret = 0; |
@@ -181,11 +182,14 @@ static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr) | |||
181 | 182 | ||
182 | 183 | ||
183 | mutex_lock(&local->iflist_mtx); | 184 | mutex_lock(&local->iflist_mtx); |
184 | list_for_each_entry(sdata, &local->interfaces, list) { | 185 | list_for_each_entry(iter, &local->interfaces, list) { |
185 | if (sdata->vif.type == NL80211_IFTYPE_MONITOR) | 186 | if (iter == sdata) |
187 | continue; | ||
188 | |||
189 | if (iter->vif.type == NL80211_IFTYPE_MONITOR) | ||
186 | continue; | 190 | continue; |
187 | 191 | ||
188 | m = sdata->vif.addr; | 192 | m = iter->vif.addr; |
189 | tmp = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) | | 193 | tmp = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) | |
190 | ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) | | 194 | ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) | |
191 | ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8); | 195 | ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8); |
@@ -209,7 +213,7 @@ static int ieee80211_change_mac(struct net_device *dev, void *addr) | |||
209 | if (ieee80211_sdata_running(sdata)) | 213 | if (ieee80211_sdata_running(sdata)) |
210 | return -EBUSY; | 214 | return -EBUSY; |
211 | 215 | ||
212 | ret = ieee80211_verify_mac(sdata->local, sa->sa_data); | 216 | ret = ieee80211_verify_mac(sdata, sa->sa_data); |
213 | if (ret) | 217 | if (ret) |
214 | return ret; | 218 | return ret; |
215 | 219 | ||
@@ -474,6 +478,9 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) | |||
474 | master->control_port_protocol; | 478 | master->control_port_protocol; |
475 | sdata->control_port_no_encrypt = | 479 | sdata->control_port_no_encrypt = |
476 | master->control_port_no_encrypt; | 480 | master->control_port_no_encrypt; |
481 | sdata->vif.cab_queue = master->vif.cab_queue; | ||
482 | memcpy(sdata->vif.hw_queue, master->vif.hw_queue, | ||
483 | sizeof(sdata->vif.hw_queue)); | ||
477 | break; | 484 | break; |
478 | } | 485 | } |
479 | case NL80211_IFTYPE_AP: | 486 | case NL80211_IFTYPE_AP: |
@@ -653,7 +660,11 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) | |||
653 | 660 | ||
654 | ieee80211_recalc_ps(local, -1); | 661 | ieee80211_recalc_ps(local, -1); |
655 | 662 | ||
656 | if (dev) { | 663 | if (sdata->vif.type == NL80211_IFTYPE_MONITOR || |
664 | sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { | ||
665 | /* XXX: for AP_VLAN, actually track AP queues */ | ||
666 | netif_tx_start_all_queues(dev); | ||
667 | } else if (dev) { | ||
657 | unsigned long flags; | 668 | unsigned long flags; |
658 | int n_acs = IEEE80211_NUM_ACS; | 669 | int n_acs = IEEE80211_NUM_ACS; |
659 | int ac; | 670 | int ac; |
@@ -1479,7 +1490,17 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local, | |||
1479 | break; | 1490 | break; |
1480 | } | 1491 | } |
1481 | 1492 | ||
1493 | /* | ||
1494 | * Pick address of existing interface in case user changed | ||
1495 | * MAC address manually, default to perm_addr. | ||
1496 | */ | ||
1482 | m = local->hw.wiphy->perm_addr; | 1497 | m = local->hw.wiphy->perm_addr; |
1498 | list_for_each_entry(sdata, &local->interfaces, list) { | ||
1499 | if (sdata->vif.type == NL80211_IFTYPE_MONITOR) | ||
1500 | continue; | ||
1501 | m = sdata->vif.addr; | ||
1502 | break; | ||
1503 | } | ||
1483 | start = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) | | 1504 | start = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) | |
1484 | ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) | | 1505 | ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) | |
1485 | ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8); | 1506 | ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8); |
@@ -1696,6 +1717,15 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local) | |||
1696 | 1717 | ||
1697 | ASSERT_RTNL(); | 1718 | ASSERT_RTNL(); |
1698 | 1719 | ||
1720 | /* | ||
1721 | * Close all AP_VLAN interfaces first, as otherwise they | ||
1722 | * might be closed while the AP interface they belong to | ||
1723 | * is closed, causing unregister_netdevice_many() to crash. | ||
1724 | */ | ||
1725 | list_for_each_entry(sdata, &local->interfaces, list) | ||
1726 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | ||
1727 | dev_close(sdata->dev); | ||
1728 | |||
1699 | mutex_lock(&local->iflist_mtx); | 1729 | mutex_lock(&local->iflist_mtx); |
1700 | list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { | 1730 | list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { |
1701 | list_del(&sdata->list); | 1731 | list_del(&sdata->list); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index a46e490f20dd..a8c2130c8ba4 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -3321,10 +3321,6 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata) | |||
3321 | if (WARN_ON_ONCE(!auth_data)) | 3321 | if (WARN_ON_ONCE(!auth_data)) |
3322 | return -EINVAL; | 3322 | return -EINVAL; |
3323 | 3323 | ||
3324 | if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) | ||
3325 | tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | | ||
3326 | IEEE80211_TX_INTFL_MLME_CONN_TX; | ||
3327 | |||
3328 | auth_data->tries++; | 3324 | auth_data->tries++; |
3329 | 3325 | ||
3330 | if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { | 3326 | if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { |
@@ -3358,6 +3354,10 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata) | |||
3358 | auth_data->expected_transaction = trans; | 3354 | auth_data->expected_transaction = trans; |
3359 | } | 3355 | } |
3360 | 3356 | ||
3357 | if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) | ||
3358 | tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | | ||
3359 | IEEE80211_TX_INTFL_MLME_CONN_TX; | ||
3360 | |||
3361 | ieee80211_send_auth(sdata, trans, auth_data->algorithm, status, | 3361 | ieee80211_send_auth(sdata, trans, auth_data->algorithm, status, |
3362 | auth_data->data, auth_data->data_len, | 3362 | auth_data->data, auth_data->data_len, |
3363 | auth_data->bss->bssid, | 3363 | auth_data->bss->bssid, |
@@ -3381,12 +3381,12 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata) | |||
3381 | * will not answer to direct packet in unassociated state. | 3381 | * will not answer to direct packet in unassociated state. |
3382 | */ | 3382 | */ |
3383 | ieee80211_send_probe_req(sdata, NULL, ssidie + 2, ssidie[1], | 3383 | ieee80211_send_probe_req(sdata, NULL, ssidie + 2, ssidie[1], |
3384 | NULL, 0, (u32) -1, true, tx_flags, | 3384 | NULL, 0, (u32) -1, true, 0, |
3385 | auth_data->bss->channel, false); | 3385 | auth_data->bss->channel, false); |
3386 | rcu_read_unlock(); | 3386 | rcu_read_unlock(); |
3387 | } | 3387 | } |
3388 | 3388 | ||
3389 | if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) { | 3389 | if (tx_flags == 0) { |
3390 | auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; | 3390 | auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; |
3391 | ifmgd->auth_data->timeout_started = true; | 3391 | ifmgd->auth_data->timeout_started = true; |
3392 | run_again(ifmgd, auth_data->timeout); | 3392 | run_again(ifmgd, auth_data->timeout); |
diff --git a/net/netfilter/core.c b/net/netfilter/core.c index 07c865a31a3d..857ca9f35177 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c | |||
@@ -30,6 +30,8 @@ static DEFINE_MUTEX(afinfo_mutex); | |||
30 | 30 | ||
31 | const struct nf_afinfo __rcu *nf_afinfo[NFPROTO_NUMPROTO] __read_mostly; | 31 | const struct nf_afinfo __rcu *nf_afinfo[NFPROTO_NUMPROTO] __read_mostly; |
32 | EXPORT_SYMBOL(nf_afinfo); | 32 | EXPORT_SYMBOL(nf_afinfo); |
33 | const struct nf_ipv6_ops __rcu *nf_ipv6_ops __read_mostly; | ||
34 | EXPORT_SYMBOL_GPL(nf_ipv6_ops); | ||
33 | 35 | ||
34 | int nf_register_afinfo(const struct nf_afinfo *afinfo) | 36 | int nf_register_afinfo(const struct nf_afinfo *afinfo) |
35 | { | 37 | { |
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index 085b5880ab0d..05565d2b3a61 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c | |||
@@ -1001,6 +1001,32 @@ static inline int is_tcp_reset(const struct sk_buff *skb, int nh_len) | |||
1001 | return th->rst; | 1001 | return th->rst; |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | static inline bool is_new_conn(const struct sk_buff *skb, | ||
1005 | struct ip_vs_iphdr *iph) | ||
1006 | { | ||
1007 | switch (iph->protocol) { | ||
1008 | case IPPROTO_TCP: { | ||
1009 | struct tcphdr _tcph, *th; | ||
1010 | |||
1011 | th = skb_header_pointer(skb, iph->len, sizeof(_tcph), &_tcph); | ||
1012 | if (th == NULL) | ||
1013 | return false; | ||
1014 | return th->syn; | ||
1015 | } | ||
1016 | case IPPROTO_SCTP: { | ||
1017 | sctp_chunkhdr_t *sch, schunk; | ||
1018 | |||
1019 | sch = skb_header_pointer(skb, iph->len + sizeof(sctp_sctphdr_t), | ||
1020 | sizeof(schunk), &schunk); | ||
1021 | if (sch == NULL) | ||
1022 | return false; | ||
1023 | return sch->type == SCTP_CID_INIT; | ||
1024 | } | ||
1025 | default: | ||
1026 | return false; | ||
1027 | } | ||
1028 | } | ||
1029 | |||
1004 | /* Handle response packets: rewrite addresses and send away... | 1030 | /* Handle response packets: rewrite addresses and send away... |
1005 | */ | 1031 | */ |
1006 | static unsigned int | 1032 | static unsigned int |
@@ -1612,6 +1638,15 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) | |||
1612 | * Check if the packet belongs to an existing connection entry | 1638 | * Check if the packet belongs to an existing connection entry |
1613 | */ | 1639 | */ |
1614 | cp = pp->conn_in_get(af, skb, &iph, 0); | 1640 | cp = pp->conn_in_get(af, skb, &iph, 0); |
1641 | |||
1642 | if (unlikely(sysctl_expire_nodest_conn(ipvs)) && cp && cp->dest && | ||
1643 | unlikely(!atomic_read(&cp->dest->weight)) && !iph.fragoffs && | ||
1644 | is_new_conn(skb, &iph)) { | ||
1645 | ip_vs_conn_expire_now(cp); | ||
1646 | __ip_vs_conn_put(cp); | ||
1647 | cp = NULL; | ||
1648 | } | ||
1649 | |||
1615 | if (unlikely(!cp) && !iph.fragoffs) { | 1650 | if (unlikely(!cp) && !iph.fragoffs) { |
1616 | /* No (second) fragments need to enter here, as nf_defrag_ipv6 | 1651 | /* No (second) fragments need to enter here, as nf_defrag_ipv6 |
1617 | * replayed fragment zero will already have created the cp | 1652 | * replayed fragment zero will already have created the cp |
diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c index 0df269d7c99f..a65edfe4b16c 100644 --- a/net/netfilter/ipvs/ip_vs_sh.c +++ b/net/netfilter/ipvs/ip_vs_sh.c | |||
@@ -67,8 +67,8 @@ struct ip_vs_sh_bucket { | |||
67 | #define IP_VS_SH_TAB_MASK (IP_VS_SH_TAB_SIZE - 1) | 67 | #define IP_VS_SH_TAB_MASK (IP_VS_SH_TAB_SIZE - 1) |
68 | 68 | ||
69 | struct ip_vs_sh_state { | 69 | struct ip_vs_sh_state { |
70 | struct ip_vs_sh_bucket buckets[IP_VS_SH_TAB_SIZE]; | ||
71 | struct rcu_head rcu_head; | 70 | struct rcu_head rcu_head; |
71 | struct ip_vs_sh_bucket buckets[IP_VS_SH_TAB_SIZE]; | ||
72 | }; | 72 | }; |
73 | 73 | ||
74 | /* | 74 | /* |
diff --git a/net/netfilter/xt_LOG.c b/net/netfilter/xt_LOG.c index 491c7d821a0b..5ab24843370a 100644 --- a/net/netfilter/xt_LOG.c +++ b/net/netfilter/xt_LOG.c | |||
@@ -737,7 +737,7 @@ static void dump_ipv6_packet(struct sbuff *m, | |||
737 | dump_sk_uid_gid(m, skb->sk); | 737 | dump_sk_uid_gid(m, skb->sk); |
738 | 738 | ||
739 | /* Max length: 16 "MARK=0xFFFFFFFF " */ | 739 | /* Max length: 16 "MARK=0xFFFFFFFF " */ |
740 | if (!recurse && skb->mark) | 740 | if (recurse && skb->mark) |
741 | sb_add(m, "MARK=0x%x ", skb->mark); | 741 | sb_add(m, "MARK=0x%x ", skb->mark); |
742 | } | 742 | } |
743 | 743 | ||
diff --git a/net/netfilter/xt_addrtype.c b/net/netfilter/xt_addrtype.c index 49c5ff7f6dd6..68ff29f60867 100644 --- a/net/netfilter/xt_addrtype.c +++ b/net/netfilter/xt_addrtype.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <net/ip6_fib.h> | 22 | #include <net/ip6_fib.h> |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | #include <linux/netfilter_ipv6.h> | ||
25 | #include <linux/netfilter/xt_addrtype.h> | 26 | #include <linux/netfilter/xt_addrtype.h> |
26 | #include <linux/netfilter/x_tables.h> | 27 | #include <linux/netfilter/x_tables.h> |
27 | 28 | ||
@@ -33,12 +34,12 @@ MODULE_ALIAS("ip6t_addrtype"); | |||
33 | 34 | ||
34 | #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) | 35 | #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) |
35 | static u32 match_lookup_rt6(struct net *net, const struct net_device *dev, | 36 | static u32 match_lookup_rt6(struct net *net, const struct net_device *dev, |
36 | const struct in6_addr *addr) | 37 | const struct in6_addr *addr, u16 mask) |
37 | { | 38 | { |
38 | const struct nf_afinfo *afinfo; | 39 | const struct nf_afinfo *afinfo; |
39 | struct flowi6 flow; | 40 | struct flowi6 flow; |
40 | struct rt6_info *rt; | 41 | struct rt6_info *rt; |
41 | u32 ret; | 42 | u32 ret = 0; |
42 | int route_err; | 43 | int route_err; |
43 | 44 | ||
44 | memset(&flow, 0, sizeof(flow)); | 45 | memset(&flow, 0, sizeof(flow)); |
@@ -49,12 +50,19 @@ static u32 match_lookup_rt6(struct net *net, const struct net_device *dev, | |||
49 | rcu_read_lock(); | 50 | rcu_read_lock(); |
50 | 51 | ||
51 | afinfo = nf_get_afinfo(NFPROTO_IPV6); | 52 | afinfo = nf_get_afinfo(NFPROTO_IPV6); |
52 | if (afinfo != NULL) | 53 | if (afinfo != NULL) { |
54 | const struct nf_ipv6_ops *v6ops; | ||
55 | |||
56 | if (dev && (mask & XT_ADDRTYPE_LOCAL)) { | ||
57 | v6ops = nf_get_ipv6_ops(); | ||
58 | if (v6ops && v6ops->chk_addr(net, addr, dev, true)) | ||
59 | ret = XT_ADDRTYPE_LOCAL; | ||
60 | } | ||
53 | route_err = afinfo->route(net, (struct dst_entry **)&rt, | 61 | route_err = afinfo->route(net, (struct dst_entry **)&rt, |
54 | flowi6_to_flowi(&flow), !!dev); | 62 | flowi6_to_flowi(&flow), false); |
55 | else | 63 | } else { |
56 | route_err = 1; | 64 | route_err = 1; |
57 | 65 | } | |
58 | rcu_read_unlock(); | 66 | rcu_read_unlock(); |
59 | 67 | ||
60 | if (route_err) | 68 | if (route_err) |
@@ -62,15 +70,12 @@ static u32 match_lookup_rt6(struct net *net, const struct net_device *dev, | |||
62 | 70 | ||
63 | if (rt->rt6i_flags & RTF_REJECT) | 71 | if (rt->rt6i_flags & RTF_REJECT) |
64 | ret = XT_ADDRTYPE_UNREACHABLE; | 72 | ret = XT_ADDRTYPE_UNREACHABLE; |
65 | else | ||
66 | ret = 0; | ||
67 | 73 | ||
68 | if (rt->rt6i_flags & RTF_LOCAL) | 74 | if (dev == NULL && rt->rt6i_flags & RTF_LOCAL) |
69 | ret |= XT_ADDRTYPE_LOCAL; | 75 | ret |= XT_ADDRTYPE_LOCAL; |
70 | if (rt->rt6i_flags & RTF_ANYCAST) | 76 | if (rt->rt6i_flags & RTF_ANYCAST) |
71 | ret |= XT_ADDRTYPE_ANYCAST; | 77 | ret |= XT_ADDRTYPE_ANYCAST; |
72 | 78 | ||
73 | |||
74 | dst_release(&rt->dst); | 79 | dst_release(&rt->dst); |
75 | return ret; | 80 | return ret; |
76 | } | 81 | } |
@@ -90,7 +95,7 @@ static bool match_type6(struct net *net, const struct net_device *dev, | |||
90 | 95 | ||
91 | if ((XT_ADDRTYPE_LOCAL | XT_ADDRTYPE_ANYCAST | | 96 | if ((XT_ADDRTYPE_LOCAL | XT_ADDRTYPE_ANYCAST | |
92 | XT_ADDRTYPE_UNREACHABLE) & mask) | 97 | XT_ADDRTYPE_UNREACHABLE) & mask) |
93 | return !!(mask & match_lookup_rt6(net, dev, addr)); | 98 | return !!(mask & match_lookup_rt6(net, dev, addr, mask)); |
94 | return true; | 99 | return true; |
95 | } | 100 | } |
96 | 101 | ||
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 12ac6b47a35c..d0b3dd60d386 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -747,7 +747,7 @@ static void netlink_skb_destructor(struct sk_buff *skb) | |||
747 | atomic_dec(&ring->pending); | 747 | atomic_dec(&ring->pending); |
748 | sock_put(sk); | 748 | sock_put(sk); |
749 | 749 | ||
750 | skb->data = NULL; | 750 | skb->head = NULL; |
751 | } | 751 | } |
752 | #endif | 752 | #endif |
753 | if (skb->sk != NULL) | 753 | if (skb->sk != NULL) |
diff --git a/net/nfc/Makefile b/net/nfc/Makefile index fb799deaed4f..a76f4533cb6c 100644 --- a/net/nfc/Makefile +++ b/net/nfc/Makefile | |||
@@ -5,7 +5,6 @@ | |||
5 | obj-$(CONFIG_NFC) += nfc.o | 5 | obj-$(CONFIG_NFC) += nfc.o |
6 | obj-$(CONFIG_NFC_NCI) += nci/ | 6 | obj-$(CONFIG_NFC_NCI) += nci/ |
7 | obj-$(CONFIG_NFC_HCI) += hci/ | 7 | obj-$(CONFIG_NFC_HCI) += hci/ |
8 | #obj-$(CONFIG_NFC_LLCP) += llcp/ | ||
9 | 8 | ||
10 | nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \ | 9 | nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \ |
11 | llcp_sock.o | 10 | llcp_sock.o |
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 823463adbd21..189e3c5b3d09 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
@@ -231,14 +231,14 @@ override: | |||
231 | } | 231 | } |
232 | if (R_tab) { | 232 | if (R_tab) { |
233 | police->rate_present = true; | 233 | police->rate_present = true; |
234 | psched_ratecfg_precompute(&police->rate, R_tab->rate.rate); | 234 | psched_ratecfg_precompute(&police->rate, &R_tab->rate); |
235 | qdisc_put_rtab(R_tab); | 235 | qdisc_put_rtab(R_tab); |
236 | } else { | 236 | } else { |
237 | police->rate_present = false; | 237 | police->rate_present = false; |
238 | } | 238 | } |
239 | if (P_tab) { | 239 | if (P_tab) { |
240 | police->peak_present = true; | 240 | police->peak_present = true; |
241 | psched_ratecfg_precompute(&police->peak, P_tab->rate.rate); | 241 | psched_ratecfg_precompute(&police->peak, &P_tab->rate); |
242 | qdisc_put_rtab(P_tab); | 242 | qdisc_put_rtab(P_tab); |
243 | } else { | 243 | } else { |
244 | police->peak_present = false; | 244 | police->peak_present = false; |
@@ -376,9 +376,9 @@ tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) | |||
376 | }; | 376 | }; |
377 | 377 | ||
378 | if (police->rate_present) | 378 | if (police->rate_present) |
379 | opt.rate.rate = psched_ratecfg_getrate(&police->rate); | 379 | psched_ratecfg_getrate(&opt.rate, &police->rate); |
380 | if (police->peak_present) | 380 | if (police->peak_present) |
381 | opt.peakrate.rate = psched_ratecfg_getrate(&police->peak); | 381 | psched_ratecfg_getrate(&opt.peakrate, &police->peak); |
382 | if (nla_put(skb, TCA_POLICE_TBF, sizeof(opt), &opt)) | 382 | if (nla_put(skb, TCA_POLICE_TBF, sizeof(opt), &opt)) |
383 | goto nla_put_failure; | 383 | goto nla_put_failure; |
384 | if (police->tcfp_result && | 384 | if (police->tcfp_result && |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index eac7e0ee23c1..20224086cc28 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -898,14 +898,16 @@ void dev_shutdown(struct net_device *dev) | |||
898 | WARN_ON(timer_pending(&dev->watchdog_timer)); | 898 | WARN_ON(timer_pending(&dev->watchdog_timer)); |
899 | } | 899 | } |
900 | 900 | ||
901 | void psched_ratecfg_precompute(struct psched_ratecfg *r, u32 rate) | 901 | void psched_ratecfg_precompute(struct psched_ratecfg *r, |
902 | const struct tc_ratespec *conf) | ||
902 | { | 903 | { |
903 | u64 factor; | 904 | u64 factor; |
904 | u64 mult; | 905 | u64 mult; |
905 | int shift; | 906 | int shift; |
906 | 907 | ||
907 | r->rate_bps = (u64)rate << 3; | 908 | memset(r, 0, sizeof(*r)); |
908 | r->shift = 0; | 909 | r->overhead = conf->overhead; |
910 | r->rate_bps = (u64)conf->rate << 3; | ||
909 | r->mult = 1; | 911 | r->mult = 1; |
910 | /* | 912 | /* |
911 | * Calibrate mult, shift so that token counting is accurate | 913 | * Calibrate mult, shift so that token counting is accurate |
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 79b1876b6cd2..adaedd79389c 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -109,7 +109,7 @@ struct htb_class { | |||
109 | } un; | 109 | } un; |
110 | struct rb_node node[TC_HTB_NUMPRIO]; /* node for self or feed tree */ | 110 | struct rb_node node[TC_HTB_NUMPRIO]; /* node for self or feed tree */ |
111 | struct rb_node pq_node; /* node for event queue */ | 111 | struct rb_node pq_node; /* node for event queue */ |
112 | psched_time_t pq_key; | 112 | s64 pq_key; |
113 | 113 | ||
114 | int prio_activity; /* for which prios are we active */ | 114 | int prio_activity; /* for which prios are we active */ |
115 | enum htb_cmode cmode; /* current mode of the class */ | 115 | enum htb_cmode cmode; /* current mode of the class */ |
@@ -121,10 +121,10 @@ struct htb_class { | |||
121 | /* token bucket parameters */ | 121 | /* token bucket parameters */ |
122 | struct psched_ratecfg rate; | 122 | struct psched_ratecfg rate; |
123 | struct psched_ratecfg ceil; | 123 | struct psched_ratecfg ceil; |
124 | s64 buffer, cbuffer; /* token bucket depth/rate */ | 124 | s64 buffer, cbuffer; /* token bucket depth/rate */ |
125 | psched_tdiff_t mbuffer; /* max wait time */ | 125 | s64 mbuffer; /* max wait time */ |
126 | s64 tokens, ctokens; /* current number of tokens */ | 126 | s64 tokens, ctokens; /* current number of tokens */ |
127 | psched_time_t t_c; /* checkpoint time */ | 127 | s64 t_c; /* checkpoint time */ |
128 | }; | 128 | }; |
129 | 129 | ||
130 | struct htb_sched { | 130 | struct htb_sched { |
@@ -141,15 +141,15 @@ struct htb_sched { | |||
141 | struct rb_root wait_pq[TC_HTB_MAXDEPTH]; | 141 | struct rb_root wait_pq[TC_HTB_MAXDEPTH]; |
142 | 142 | ||
143 | /* time of nearest event per level (row) */ | 143 | /* time of nearest event per level (row) */ |
144 | psched_time_t near_ev_cache[TC_HTB_MAXDEPTH]; | 144 | s64 near_ev_cache[TC_HTB_MAXDEPTH]; |
145 | 145 | ||
146 | int defcls; /* class where unclassified flows go to */ | 146 | int defcls; /* class where unclassified flows go to */ |
147 | 147 | ||
148 | /* filters for qdisc itself */ | 148 | /* filters for qdisc itself */ |
149 | struct tcf_proto *filter_list; | 149 | struct tcf_proto *filter_list; |
150 | 150 | ||
151 | int rate2quantum; /* quant = rate / rate2quantum */ | 151 | int rate2quantum; /* quant = rate / rate2quantum */ |
152 | psched_time_t now; /* cached dequeue time */ | 152 | s64 now; /* cached dequeue time */ |
153 | struct qdisc_watchdog watchdog; | 153 | struct qdisc_watchdog watchdog; |
154 | 154 | ||
155 | /* non shaped skbs; let them go directly thru */ | 155 | /* non shaped skbs; let them go directly thru */ |
@@ -664,8 +664,8 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl, | |||
664 | * next pending event (0 for no event in pq, q->now for too many events). | 664 | * next pending event (0 for no event in pq, q->now for too many events). |
665 | * Note: Applied are events whose have cl->pq_key <= q->now. | 665 | * Note: Applied are events whose have cl->pq_key <= q->now. |
666 | */ | 666 | */ |
667 | static psched_time_t htb_do_events(struct htb_sched *q, int level, | 667 | static s64 htb_do_events(struct htb_sched *q, int level, |
668 | unsigned long start) | 668 | unsigned long start) |
669 | { | 669 | { |
670 | /* don't run for longer than 2 jiffies; 2 is used instead of | 670 | /* don't run for longer than 2 jiffies; 2 is used instead of |
671 | * 1 to simplify things when jiffy is going to be incremented | 671 | * 1 to simplify things when jiffy is going to be incremented |
@@ -857,7 +857,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
857 | struct sk_buff *skb; | 857 | struct sk_buff *skb; |
858 | struct htb_sched *q = qdisc_priv(sch); | 858 | struct htb_sched *q = qdisc_priv(sch); |
859 | int level; | 859 | int level; |
860 | psched_time_t next_event; | 860 | s64 next_event; |
861 | unsigned long start_at; | 861 | unsigned long start_at; |
862 | 862 | ||
863 | /* try to dequeue direct packets as high prio (!) to minimize cpu work */ | 863 | /* try to dequeue direct packets as high prio (!) to minimize cpu work */ |
@@ -880,7 +880,7 @@ ok: | |||
880 | for (level = 0; level < TC_HTB_MAXDEPTH; level++) { | 880 | for (level = 0; level < TC_HTB_MAXDEPTH; level++) { |
881 | /* common case optimization - skip event handler quickly */ | 881 | /* common case optimization - skip event handler quickly */ |
882 | int m; | 882 | int m; |
883 | psched_time_t event; | 883 | s64 event; |
884 | 884 | ||
885 | if (q->now >= q->near_ev_cache[level]) { | 885 | if (q->now >= q->near_ev_cache[level]) { |
886 | event = htb_do_events(q, level, start_at); | 886 | event = htb_do_events(q, level, start_at); |
@@ -1090,9 +1090,9 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg, | |||
1090 | 1090 | ||
1091 | memset(&opt, 0, sizeof(opt)); | 1091 | memset(&opt, 0, sizeof(opt)); |
1092 | 1092 | ||
1093 | opt.rate.rate = psched_ratecfg_getrate(&cl->rate); | 1093 | psched_ratecfg_getrate(&opt.rate, &cl->rate); |
1094 | opt.buffer = PSCHED_NS2TICKS(cl->buffer); | 1094 | opt.buffer = PSCHED_NS2TICKS(cl->buffer); |
1095 | opt.ceil.rate = psched_ratecfg_getrate(&cl->ceil); | 1095 | psched_ratecfg_getrate(&opt.ceil, &cl->ceil); |
1096 | opt.cbuffer = PSCHED_NS2TICKS(cl->cbuffer); | 1096 | opt.cbuffer = PSCHED_NS2TICKS(cl->cbuffer); |
1097 | opt.quantum = cl->quantum; | 1097 | opt.quantum = cl->quantum; |
1098 | opt.prio = cl->prio; | 1098 | opt.prio = cl->prio; |
@@ -1117,8 +1117,8 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d) | |||
1117 | 1117 | ||
1118 | if (!cl->level && cl->un.leaf.q) | 1118 | if (!cl->level && cl->un.leaf.q) |
1119 | cl->qstats.qlen = cl->un.leaf.q->q.qlen; | 1119 | cl->qstats.qlen = cl->un.leaf.q->q.qlen; |
1120 | cl->xstats.tokens = cl->tokens; | 1120 | cl->xstats.tokens = PSCHED_NS2TICKS(cl->tokens); |
1121 | cl->xstats.ctokens = cl->ctokens; | 1121 | cl->xstats.ctokens = PSCHED_NS2TICKS(cl->ctokens); |
1122 | 1122 | ||
1123 | if (gnet_stats_copy_basic(d, &cl->bstats) < 0 || | 1123 | if (gnet_stats_copy_basic(d, &cl->bstats) < 0 || |
1124 | gnet_stats_copy_rate_est(d, NULL, &cl->rate_est) < 0 || | 1124 | gnet_stats_copy_rate_est(d, NULL, &cl->rate_est) < 0 || |
@@ -1200,7 +1200,7 @@ static void htb_parent_to_leaf(struct htb_sched *q, struct htb_class *cl, | |||
1200 | parent->un.leaf.q = new_q ? new_q : &noop_qdisc; | 1200 | parent->un.leaf.q = new_q ? new_q : &noop_qdisc; |
1201 | parent->tokens = parent->buffer; | 1201 | parent->tokens = parent->buffer; |
1202 | parent->ctokens = parent->cbuffer; | 1202 | parent->ctokens = parent->cbuffer; |
1203 | parent->t_c = psched_get_time(); | 1203 | parent->t_c = ktime_to_ns(ktime_get()); |
1204 | parent->cmode = HTB_CAN_SEND; | 1204 | parent->cmode = HTB_CAN_SEND; |
1205 | } | 1205 | } |
1206 | 1206 | ||
@@ -1417,8 +1417,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
1417 | /* set class to be in HTB_CAN_SEND state */ | 1417 | /* set class to be in HTB_CAN_SEND state */ |
1418 | cl->tokens = PSCHED_TICKS2NS(hopt->buffer); | 1418 | cl->tokens = PSCHED_TICKS2NS(hopt->buffer); |
1419 | cl->ctokens = PSCHED_TICKS2NS(hopt->cbuffer); | 1419 | cl->ctokens = PSCHED_TICKS2NS(hopt->cbuffer); |
1420 | cl->mbuffer = 60 * PSCHED_TICKS_PER_SEC; /* 1min */ | 1420 | cl->mbuffer = 60ULL * NSEC_PER_SEC; /* 1min */ |
1421 | cl->t_c = psched_get_time(); | 1421 | cl->t_c = ktime_to_ns(ktime_get()); |
1422 | cl->cmode = HTB_CAN_SEND; | 1422 | cl->cmode = HTB_CAN_SEND; |
1423 | 1423 | ||
1424 | /* attach to the hash list and parent's family */ | 1424 | /* attach to the hash list and parent's family */ |
@@ -1459,8 +1459,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
1459 | cl->prio = TC_HTB_NUMPRIO - 1; | 1459 | cl->prio = TC_HTB_NUMPRIO - 1; |
1460 | } | 1460 | } |
1461 | 1461 | ||
1462 | psched_ratecfg_precompute(&cl->rate, hopt->rate.rate); | 1462 | psched_ratecfg_precompute(&cl->rate, &hopt->rate); |
1463 | psched_ratecfg_precompute(&cl->ceil, hopt->ceil.rate); | 1463 | psched_ratecfg_precompute(&cl->ceil, &hopt->ceil); |
1464 | 1464 | ||
1465 | cl->buffer = PSCHED_TICKS2NS(hopt->buffer); | 1465 | cl->buffer = PSCHED_TICKS2NS(hopt->buffer); |
1466 | cl->cbuffer = PSCHED_TICKS2NS(hopt->buffer); | 1466 | cl->cbuffer = PSCHED_TICKS2NS(hopt->buffer); |
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index c8388f3c3426..e478d316602b 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -298,9 +298,9 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt) | |||
298 | q->tokens = q->buffer; | 298 | q->tokens = q->buffer; |
299 | q->ptokens = q->mtu; | 299 | q->ptokens = q->mtu; |
300 | 300 | ||
301 | psched_ratecfg_precompute(&q->rate, rtab->rate.rate); | 301 | psched_ratecfg_precompute(&q->rate, &rtab->rate); |
302 | if (ptab) { | 302 | if (ptab) { |
303 | psched_ratecfg_precompute(&q->peak, ptab->rate.rate); | 303 | psched_ratecfg_precompute(&q->peak, &ptab->rate); |
304 | q->peak_present = true; | 304 | q->peak_present = true; |
305 | } else { | 305 | } else { |
306 | q->peak_present = false; | 306 | q->peak_present = false; |
@@ -350,9 +350,9 @@ static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb) | |||
350 | goto nla_put_failure; | 350 | goto nla_put_failure; |
351 | 351 | ||
352 | opt.limit = q->limit; | 352 | opt.limit = q->limit; |
353 | opt.rate.rate = psched_ratecfg_getrate(&q->rate); | 353 | psched_ratecfg_getrate(&opt.rate, &q->rate); |
354 | if (q->peak_present) | 354 | if (q->peak_present) |
355 | opt.peakrate.rate = psched_ratecfg_getrate(&q->peak); | 355 | psched_ratecfg_getrate(&opt.peakrate, &q->peak); |
356 | else | 356 | else |
357 | memset(&opt.peakrate, 0, sizeof(opt.peakrate)); | 357 | memset(&opt.peakrate, 0, sizeof(opt.peakrate)); |
358 | opt.mtu = PSCHED_NS2TICKS(q->mtu); | 358 | opt.mtu = PSCHED_NS2TICKS(q->mtu); |
diff --git a/net/socket.c b/net/socket.c index 6b94633ca61d..4ca1526db756 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1956,7 +1956,7 @@ struct used_address { | |||
1956 | unsigned int name_len; | 1956 | unsigned int name_len; |
1957 | }; | 1957 | }; |
1958 | 1958 | ||
1959 | static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg, | 1959 | static int ___sys_sendmsg(struct socket *sock, struct msghdr __user *msg, |
1960 | struct msghdr *msg_sys, unsigned int flags, | 1960 | struct msghdr *msg_sys, unsigned int flags, |
1961 | struct used_address *used_address) | 1961 | struct used_address *used_address) |
1962 | { | 1962 | { |
@@ -2071,22 +2071,30 @@ out: | |||
2071 | * BSD sendmsg interface | 2071 | * BSD sendmsg interface |
2072 | */ | 2072 | */ |
2073 | 2073 | ||
2074 | SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned int, flags) | 2074 | long __sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags) |
2075 | { | 2075 | { |
2076 | int fput_needed, err; | 2076 | int fput_needed, err; |
2077 | struct msghdr msg_sys; | 2077 | struct msghdr msg_sys; |
2078 | struct socket *sock = sockfd_lookup_light(fd, &err, &fput_needed); | 2078 | struct socket *sock; |
2079 | 2079 | ||
2080 | sock = sockfd_lookup_light(fd, &err, &fput_needed); | ||
2080 | if (!sock) | 2081 | if (!sock) |
2081 | goto out; | 2082 | goto out; |
2082 | 2083 | ||
2083 | err = __sys_sendmsg(sock, msg, &msg_sys, flags, NULL); | 2084 | err = ___sys_sendmsg(sock, msg, &msg_sys, flags, NULL); |
2084 | 2085 | ||
2085 | fput_light(sock->file, fput_needed); | 2086 | fput_light(sock->file, fput_needed); |
2086 | out: | 2087 | out: |
2087 | return err; | 2088 | return err; |
2088 | } | 2089 | } |
2089 | 2090 | ||
2091 | SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned int, flags) | ||
2092 | { | ||
2093 | if (flags & MSG_CMSG_COMPAT) | ||
2094 | return -EINVAL; | ||
2095 | return __sys_sendmsg(fd, msg, flags); | ||
2096 | } | ||
2097 | |||
2090 | /* | 2098 | /* |
2091 | * Linux sendmmsg interface | 2099 | * Linux sendmmsg interface |
2092 | */ | 2100 | */ |
@@ -2117,15 +2125,16 @@ int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, | |||
2117 | 2125 | ||
2118 | while (datagrams < vlen) { | 2126 | while (datagrams < vlen) { |
2119 | if (MSG_CMSG_COMPAT & flags) { | 2127 | if (MSG_CMSG_COMPAT & flags) { |
2120 | err = __sys_sendmsg(sock, (struct msghdr __user *)compat_entry, | 2128 | err = ___sys_sendmsg(sock, (struct msghdr __user *)compat_entry, |
2121 | &msg_sys, flags, &used_address); | 2129 | &msg_sys, flags, &used_address); |
2122 | if (err < 0) | 2130 | if (err < 0) |
2123 | break; | 2131 | break; |
2124 | err = __put_user(err, &compat_entry->msg_len); | 2132 | err = __put_user(err, &compat_entry->msg_len); |
2125 | ++compat_entry; | 2133 | ++compat_entry; |
2126 | } else { | 2134 | } else { |
2127 | err = __sys_sendmsg(sock, (struct msghdr __user *)entry, | 2135 | err = ___sys_sendmsg(sock, |
2128 | &msg_sys, flags, &used_address); | 2136 | (struct msghdr __user *)entry, |
2137 | &msg_sys, flags, &used_address); | ||
2129 | if (err < 0) | 2138 | if (err < 0) |
2130 | break; | 2139 | break; |
2131 | err = put_user(err, &entry->msg_len); | 2140 | err = put_user(err, &entry->msg_len); |
@@ -2149,10 +2158,12 @@ int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, | |||
2149 | SYSCALL_DEFINE4(sendmmsg, int, fd, struct mmsghdr __user *, mmsg, | 2158 | SYSCALL_DEFINE4(sendmmsg, int, fd, struct mmsghdr __user *, mmsg, |
2150 | unsigned int, vlen, unsigned int, flags) | 2159 | unsigned int, vlen, unsigned int, flags) |
2151 | { | 2160 | { |
2161 | if (flags & MSG_CMSG_COMPAT) | ||
2162 | return -EINVAL; | ||
2152 | return __sys_sendmmsg(fd, mmsg, vlen, flags); | 2163 | return __sys_sendmmsg(fd, mmsg, vlen, flags); |
2153 | } | 2164 | } |
2154 | 2165 | ||
2155 | static int __sys_recvmsg(struct socket *sock, struct msghdr __user *msg, | 2166 | static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg, |
2156 | struct msghdr *msg_sys, unsigned int flags, int nosec) | 2167 | struct msghdr *msg_sys, unsigned int flags, int nosec) |
2157 | { | 2168 | { |
2158 | struct compat_msghdr __user *msg_compat = | 2169 | struct compat_msghdr __user *msg_compat = |
@@ -2244,23 +2255,31 @@ out: | |||
2244 | * BSD recvmsg interface | 2255 | * BSD recvmsg interface |
2245 | */ | 2256 | */ |
2246 | 2257 | ||
2247 | SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg, | 2258 | long __sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags) |
2248 | unsigned int, flags) | ||
2249 | { | 2259 | { |
2250 | int fput_needed, err; | 2260 | int fput_needed, err; |
2251 | struct msghdr msg_sys; | 2261 | struct msghdr msg_sys; |
2252 | struct socket *sock = sockfd_lookup_light(fd, &err, &fput_needed); | 2262 | struct socket *sock; |
2253 | 2263 | ||
2264 | sock = sockfd_lookup_light(fd, &err, &fput_needed); | ||
2254 | if (!sock) | 2265 | if (!sock) |
2255 | goto out; | 2266 | goto out; |
2256 | 2267 | ||
2257 | err = __sys_recvmsg(sock, msg, &msg_sys, flags, 0); | 2268 | err = ___sys_recvmsg(sock, msg, &msg_sys, flags, 0); |
2258 | 2269 | ||
2259 | fput_light(sock->file, fput_needed); | 2270 | fput_light(sock->file, fput_needed); |
2260 | out: | 2271 | out: |
2261 | return err; | 2272 | return err; |
2262 | } | 2273 | } |
2263 | 2274 | ||
2275 | SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg, | ||
2276 | unsigned int, flags) | ||
2277 | { | ||
2278 | if (flags & MSG_CMSG_COMPAT) | ||
2279 | return -EINVAL; | ||
2280 | return __sys_recvmsg(fd, msg, flags); | ||
2281 | } | ||
2282 | |||
2264 | /* | 2283 | /* |
2265 | * Linux recvmmsg interface | 2284 | * Linux recvmmsg interface |
2266 | */ | 2285 | */ |
@@ -2298,17 +2317,18 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, | |||
2298 | * No need to ask LSM for more than the first datagram. | 2317 | * No need to ask LSM for more than the first datagram. |
2299 | */ | 2318 | */ |
2300 | if (MSG_CMSG_COMPAT & flags) { | 2319 | if (MSG_CMSG_COMPAT & flags) { |
2301 | err = __sys_recvmsg(sock, (struct msghdr __user *)compat_entry, | 2320 | err = ___sys_recvmsg(sock, (struct msghdr __user *)compat_entry, |
2302 | &msg_sys, flags & ~MSG_WAITFORONE, | 2321 | &msg_sys, flags & ~MSG_WAITFORONE, |
2303 | datagrams); | 2322 | datagrams); |
2304 | if (err < 0) | 2323 | if (err < 0) |
2305 | break; | 2324 | break; |
2306 | err = __put_user(err, &compat_entry->msg_len); | 2325 | err = __put_user(err, &compat_entry->msg_len); |
2307 | ++compat_entry; | 2326 | ++compat_entry; |
2308 | } else { | 2327 | } else { |
2309 | err = __sys_recvmsg(sock, (struct msghdr __user *)entry, | 2328 | err = ___sys_recvmsg(sock, |
2310 | &msg_sys, flags & ~MSG_WAITFORONE, | 2329 | (struct msghdr __user *)entry, |
2311 | datagrams); | 2330 | &msg_sys, flags & ~MSG_WAITFORONE, |
2331 | datagrams); | ||
2312 | if (err < 0) | 2332 | if (err < 0) |
2313 | break; | 2333 | break; |
2314 | err = put_user(err, &entry->msg_len); | 2334 | err = put_user(err, &entry->msg_len); |
@@ -2375,6 +2395,9 @@ SYSCALL_DEFINE5(recvmmsg, int, fd, struct mmsghdr __user *, mmsg, | |||
2375 | int datagrams; | 2395 | int datagrams; |
2376 | struct timespec timeout_sys; | 2396 | struct timespec timeout_sys; |
2377 | 2397 | ||
2398 | if (flags & MSG_CMSG_COMPAT) | ||
2399 | return -EINVAL; | ||
2400 | |||
2378 | if (!timeout) | 2401 | if (!timeout) |
2379 | return __sys_recvmmsg(fd, mmsg, vlen, flags, NULL); | 2402 | return __sys_recvmmsg(fd, mmsg, vlen, flags, NULL); |
2380 | 2403 | ||
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 871c73c92165..29b4ba93ab3c 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -1287,7 +1287,7 @@ static bool use_gss_proxy(struct net *net) | |||
1287 | 1287 | ||
1288 | #ifdef CONFIG_PROC_FS | 1288 | #ifdef CONFIG_PROC_FS |
1289 | 1289 | ||
1290 | static bool set_gss_proxy(struct net *net, int type) | 1290 | static int set_gss_proxy(struct net *net, int type) |
1291 | { | 1291 | { |
1292 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); | 1292 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); |
1293 | int ret = 0; | 1293 | int ret = 0; |
@@ -1317,10 +1317,12 @@ static inline bool gssp_ready(struct sunrpc_net *sn) | |||
1317 | return false; | 1317 | return false; |
1318 | } | 1318 | } |
1319 | 1319 | ||
1320 | static int wait_for_gss_proxy(struct net *net) | 1320 | static int wait_for_gss_proxy(struct net *net, struct file *file) |
1321 | { | 1321 | { |
1322 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); | 1322 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); |
1323 | 1323 | ||
1324 | if (file->f_flags & O_NONBLOCK && !gssp_ready(sn)) | ||
1325 | return -EAGAIN; | ||
1324 | return wait_event_interruptible(sn->gssp_wq, gssp_ready(sn)); | 1326 | return wait_event_interruptible(sn->gssp_wq, gssp_ready(sn)); |
1325 | } | 1327 | } |
1326 | 1328 | ||
@@ -1362,7 +1364,7 @@ static ssize_t read_gssp(struct file *file, char __user *buf, | |||
1362 | size_t len; | 1364 | size_t len; |
1363 | int ret; | 1365 | int ret; |
1364 | 1366 | ||
1365 | ret = wait_for_gss_proxy(net); | 1367 | ret = wait_for_gss_proxy(net, file); |
1366 | if (ret) | 1368 | if (ret) |
1367 | return ret; | 1369 | return ret; |
1368 | 1370 | ||
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index c3f9e1ef7f53..06bdf5a1082c 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
@@ -810,11 +810,15 @@ svcauth_unix_accept(struct svc_rqst *rqstp, __be32 *authp) | |||
810 | goto badcred; | 810 | goto badcred; |
811 | argv->iov_base = (void*)((__be32*)argv->iov_base + slen); /* skip machname */ | 811 | argv->iov_base = (void*)((__be32*)argv->iov_base + slen); /* skip machname */ |
812 | argv->iov_len -= slen*4; | 812 | argv->iov_len -= slen*4; |
813 | 813 | /* | |
814 | * Note: we skip uid_valid()/gid_valid() checks here for | ||
815 | * backwards compatibility with clients that use -1 id's. | ||
816 | * Instead, -1 uid or gid is later mapped to the | ||
817 | * (export-specific) anonymous id by nfsd_setuser. | ||
818 | * Supplementary gid's will be left alone. | ||
819 | */ | ||
814 | cred->cr_uid = make_kuid(&init_user_ns, svc_getnl(argv)); /* uid */ | 820 | cred->cr_uid = make_kuid(&init_user_ns, svc_getnl(argv)); /* uid */ |
815 | cred->cr_gid = make_kgid(&init_user_ns, svc_getnl(argv)); /* gid */ | 821 | cred->cr_gid = make_kgid(&init_user_ns, svc_getnl(argv)); /* gid */ |
816 | if (!uid_valid(cred->cr_uid) || !gid_valid(cred->cr_gid)) | ||
817 | goto badcred; | ||
818 | slen = svc_getnl(argv); /* gids length */ | 822 | slen = svc_getnl(argv); /* gids length */ |
819 | if (slen > 16 || (len -= (slen + 2)*4) < 0) | 823 | if (slen > 16 || (len -= (slen + 2)*4) < 0) |
820 | goto badcred; | 824 | goto badcred; |
@@ -823,8 +827,6 @@ svcauth_unix_accept(struct svc_rqst *rqstp, __be32 *authp) | |||
823 | return SVC_CLOSE; | 827 | return SVC_CLOSE; |
824 | for (i = 0; i < slen; i++) { | 828 | for (i = 0; i < slen; i++) { |
825 | kgid_t kgid = make_kgid(&init_user_ns, svc_getnl(argv)); | 829 | kgid_t kgid = make_kgid(&init_user_ns, svc_getnl(argv)); |
826 | if (!gid_valid(kgid)) | ||
827 | goto badcred; | ||
828 | GROUP_AT(cred->cr_group_info, i) = kgid; | 830 | GROUP_AT(cred->cr_group_info, i) = kgid; |
829 | } | 831 | } |
830 | if (svc_getu32(argv) != htonl(RPC_AUTH_NULL) || svc_getu32(argv) != 0) { | 832 | if (svc_getu32(argv) != htonl(RPC_AUTH_NULL) || svc_getu32(argv) != 0) { |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index dfdb5e643211..d5aed3bb3945 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3411,7 +3411,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 portid, u32 seq, | |||
3411 | (u32)sinfo->rx_bytes)) | 3411 | (u32)sinfo->rx_bytes)) |
3412 | goto nla_put_failure; | 3412 | goto nla_put_failure; |
3413 | if ((sinfo->filled & (STATION_INFO_TX_BYTES | | 3413 | if ((sinfo->filled & (STATION_INFO_TX_BYTES | |
3414 | NL80211_STA_INFO_TX_BYTES64)) && | 3414 | STATION_INFO_TX_BYTES64)) && |
3415 | nla_put_u32(msg, NL80211_STA_INFO_TX_BYTES, | 3415 | nla_put_u32(msg, NL80211_STA_INFO_TX_BYTES, |
3416 | (u32)sinfo->tx_bytes)) | 3416 | (u32)sinfo->tx_bytes)) |
3417 | goto nla_put_failure; | 3417 | goto nla_put_failure; |
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 8b5eddfba1e5..3ed35c345cae 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -231,6 +231,9 @@ void cfg80211_conn_work(struct work_struct *work) | |||
231 | mutex_lock(&rdev->sched_scan_mtx); | 231 | mutex_lock(&rdev->sched_scan_mtx); |
232 | 232 | ||
233 | list_for_each_entry(wdev, &rdev->wdev_list, list) { | 233 | list_for_each_entry(wdev, &rdev->wdev_list, list) { |
234 | if (!wdev->netdev) | ||
235 | continue; | ||
236 | |||
234 | wdev_lock(wdev); | 237 | wdev_lock(wdev); |
235 | if (!netif_running(wdev->netdev)) { | 238 | if (!netif_running(wdev->netdev)) { |
236 | wdev_unlock(wdev); | 239 | wdev_unlock(wdev); |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 23cea0f74336..ea970b8002a2 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -2557,11 +2557,12 @@ static void __xfrm_garbage_collect(struct net *net) | |||
2557 | } | 2557 | } |
2558 | } | 2558 | } |
2559 | 2559 | ||
2560 | static void xfrm_garbage_collect(struct net *net) | 2560 | void xfrm_garbage_collect(struct net *net) |
2561 | { | 2561 | { |
2562 | flow_cache_flush(); | 2562 | flow_cache_flush(); |
2563 | __xfrm_garbage_collect(net); | 2563 | __xfrm_garbage_collect(net); |
2564 | } | 2564 | } |
2565 | EXPORT_SYMBOL(xfrm_garbage_collect); | ||
2565 | 2566 | ||
2566 | static void xfrm_garbage_collect_deferred(struct net *net) | 2567 | static void xfrm_garbage_collect_deferred(struct net *net) |
2567 | { | 2568 | { |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index aa778748c565..3f565e495ac6 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -1681,6 +1681,8 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1681 | 1681 | ||
1682 | out: | 1682 | out: |
1683 | xfrm_pol_put(xp); | 1683 | xfrm_pol_put(xp); |
1684 | if (delete && err == 0) | ||
1685 | xfrm_garbage_collect(net); | ||
1684 | return err; | 1686 | return err; |
1685 | } | 1687 | } |
1686 | 1688 | ||