aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-05-27 11:16:53 -0400
committerTakashi Iwai <tiwai@suse.de>2016-05-27 11:16:53 -0400
commiteb4606e64a7d548f5d60a9583baa8104890b2c6e (patch)
tree2dc8e587fc79c207dab2fb74830963cc84dcf801 /net
parent86c72d1ce91d804e4fa8d90b316a89597dd220f1 (diff)
parentbf65921380cd50b87618df550398e06581f4a361 (diff)
Merge tag 'asoc-v4.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v4.7 part 2 Really sorry about this late pull request. It looks like at the time I sent my pull request for v4.7 there was some conflict or other issue which caused my script to stop merging the ASoC branches at some point after the HDMI changes. It's all specific driver updates, including: - New drivers for MAX98371 and TAS5720. - SPI support for TLV320AIC32x4. - TDM support for STI Uniperf IPs. This code should all have been in -next prior to the merge window apart from some fixes, it dropped out on the 18th.
Diffstat (limited to 'net')
-rw-r--r--net/bridge/br_ioctl.c5
-rw-r--r--net/bridge/br_multicast.c12
-rw-r--r--net/core/flow.c14
-rw-r--r--net/core/rtnetlink.c18
-rw-r--r--net/ipv4/fib_semantics.c2
-rw-r--r--net/ipv4/fou.c6
-rw-r--r--net/ipv4/ip_gre.c7
-rw-r--r--net/ipv4/ip_vti.c18
-rw-r--r--net/ipv4/tcp_output.c6
-rw-r--r--net/ipv4/udp_offload.c8
-rw-r--r--net/ipv6/icmp.c5
-rw-r--r--net/ipv6/route.c2
-rw-r--r--net/ipv6/tcp_ipv6.c7
-rw-r--r--net/llc/af_llc.c1
-rw-r--r--net/netfilter/nf_conntrack_core.c6
-rw-r--r--net/netfilter/nfnetlink_acct.c2
-rw-r--r--net/netfilter/xt_IDLETIMER.c1
-rw-r--r--net/openvswitch/conntrack.c13
-rw-r--r--net/sched/act_ife.c14
-rw-r--r--net/sched/act_ipt.c19
-rw-r--r--net/sched/act_mirred.c19
-rw-r--r--net/sched/act_simple.c18
-rw-r--r--net/sched/act_skbedit.c18
-rw-r--r--net/sched/act_vlan.c22
-rw-r--r--net/vmw_vsock/af_vsock.c21
-rw-r--r--net/x25/x25_facilities.c1
-rw-r--r--net/xfrm/xfrm_output.c3
27 files changed, 182 insertions, 86 deletions
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c
index 263b4de4de57..60a3dbfca8a1 100644
--- a/net/bridge/br_ioctl.c
+++ b/net/bridge/br_ioctl.c
@@ -21,18 +21,19 @@
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include "br_private.h" 22#include "br_private.h"
23 23
24/* called with RTNL */
25static int get_bridge_ifindices(struct net *net, int *indices, int num) 24static int get_bridge_ifindices(struct net *net, int *indices, int num)
26{ 25{
27 struct net_device *dev; 26 struct net_device *dev;
28 int i = 0; 27 int i = 0;
29 28
30 for_each_netdev(net, dev) { 29 rcu_read_lock();
30 for_each_netdev_rcu(net, dev) {
31 if (i >= num) 31 if (i >= num)
32 break; 32 break;
33 if (dev->priv_flags & IFF_EBRIDGE) 33 if (dev->priv_flags & IFF_EBRIDGE)
34 indices[i++] = dev->ifindex; 34 indices[i++] = dev->ifindex;
35 } 35 }
36 rcu_read_unlock();
36 37
37 return i; 38 return i;
38} 39}
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 191ea66e4d92..6852f3c7009c 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1279,6 +1279,7 @@ static int br_ip4_multicast_query(struct net_bridge *br,
1279 struct br_ip saddr; 1279 struct br_ip saddr;
1280 unsigned long max_delay; 1280 unsigned long max_delay;
1281 unsigned long now = jiffies; 1281 unsigned long now = jiffies;
1282 unsigned int offset = skb_transport_offset(skb);
1282 __be32 group; 1283 __be32 group;
1283 int err = 0; 1284 int err = 0;
1284 1285
@@ -1289,14 +1290,14 @@ static int br_ip4_multicast_query(struct net_bridge *br,
1289 1290
1290 group = ih->group; 1291 group = ih->group;
1291 1292
1292 if (skb->len == sizeof(*ih)) { 1293 if (skb->len == offset + sizeof(*ih)) {
1293 max_delay = ih->code * (HZ / IGMP_TIMER_SCALE); 1294 max_delay = ih->code * (HZ / IGMP_TIMER_SCALE);
1294 1295
1295 if (!max_delay) { 1296 if (!max_delay) {
1296 max_delay = 10 * HZ; 1297 max_delay = 10 * HZ;
1297 group = 0; 1298 group = 0;
1298 } 1299 }
1299 } else if (skb->len >= sizeof(*ih3)) { 1300 } else if (skb->len >= offset + sizeof(*ih3)) {
1300 ih3 = igmpv3_query_hdr(skb); 1301 ih3 = igmpv3_query_hdr(skb);
1301 if (ih3->nsrcs) 1302 if (ih3->nsrcs)
1302 goto out; 1303 goto out;
@@ -1357,6 +1358,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
1357 struct br_ip saddr; 1358 struct br_ip saddr;
1358 unsigned long max_delay; 1359 unsigned long max_delay;
1359 unsigned long now = jiffies; 1360 unsigned long now = jiffies;
1361 unsigned int offset = skb_transport_offset(skb);
1360 const struct in6_addr *group = NULL; 1362 const struct in6_addr *group = NULL;
1361 bool is_general_query; 1363 bool is_general_query;
1362 int err = 0; 1364 int err = 0;
@@ -1366,8 +1368,8 @@ static int br_ip6_multicast_query(struct net_bridge *br,
1366 (port && port->state == BR_STATE_DISABLED)) 1368 (port && port->state == BR_STATE_DISABLED))
1367 goto out; 1369 goto out;
1368 1370
1369 if (skb->len == sizeof(*mld)) { 1371 if (skb->len == offset + sizeof(*mld)) {
1370 if (!pskb_may_pull(skb, sizeof(*mld))) { 1372 if (!pskb_may_pull(skb, offset + sizeof(*mld))) {
1371 err = -EINVAL; 1373 err = -EINVAL;
1372 goto out; 1374 goto out;
1373 } 1375 }
@@ -1376,7 +1378,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
1376 if (max_delay) 1378 if (max_delay)
1377 group = &mld->mld_mca; 1379 group = &mld->mld_mca;
1378 } else { 1380 } else {
1379 if (!pskb_may_pull(skb, sizeof(*mld2q))) { 1381 if (!pskb_may_pull(skb, offset + sizeof(*mld2q))) {
1380 err = -EINVAL; 1382 err = -EINVAL;
1381 goto out; 1383 goto out;
1382 } 1384 }
diff --git a/net/core/flow.c b/net/core/flow.c
index 1033725be40b..3937b1b68d5b 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -92,8 +92,11 @@ static void flow_cache_gc_task(struct work_struct *work)
92 list_splice_tail_init(&xfrm->flow_cache_gc_list, &gc_list); 92 list_splice_tail_init(&xfrm->flow_cache_gc_list, &gc_list);
93 spin_unlock_bh(&xfrm->flow_cache_gc_lock); 93 spin_unlock_bh(&xfrm->flow_cache_gc_lock);
94 94
95 list_for_each_entry_safe(fce, n, &gc_list, u.gc_list) 95 list_for_each_entry_safe(fce, n, &gc_list, u.gc_list) {
96 flow_entry_kill(fce, xfrm); 96 flow_entry_kill(fce, xfrm);
97 atomic_dec(&xfrm->flow_cache_gc_count);
98 WARN_ON(atomic_read(&xfrm->flow_cache_gc_count) < 0);
99 }
97} 100}
98 101
99static void flow_cache_queue_garbage(struct flow_cache_percpu *fcp, 102static void flow_cache_queue_garbage(struct flow_cache_percpu *fcp,
@@ -101,6 +104,7 @@ static void flow_cache_queue_garbage(struct flow_cache_percpu *fcp,
101 struct netns_xfrm *xfrm) 104 struct netns_xfrm *xfrm)
102{ 105{
103 if (deleted) { 106 if (deleted) {
107 atomic_add(deleted, &xfrm->flow_cache_gc_count);
104 fcp->hash_count -= deleted; 108 fcp->hash_count -= deleted;
105 spin_lock_bh(&xfrm->flow_cache_gc_lock); 109 spin_lock_bh(&xfrm->flow_cache_gc_lock);
106 list_splice_tail(gc_list, &xfrm->flow_cache_gc_list); 110 list_splice_tail(gc_list, &xfrm->flow_cache_gc_list);
@@ -232,6 +236,13 @@ flow_cache_lookup(struct net *net, const struct flowi *key, u16 family, u8 dir,
232 if (fcp->hash_count > fc->high_watermark) 236 if (fcp->hash_count > fc->high_watermark)
233 flow_cache_shrink(fc, fcp); 237 flow_cache_shrink(fc, fcp);
234 238
239 if (fcp->hash_count > 2 * fc->high_watermark ||
240 atomic_read(&net->xfrm.flow_cache_gc_count) > fc->high_watermark) {
241 atomic_inc(&net->xfrm.flow_cache_genid);
242 flo = ERR_PTR(-ENOBUFS);
243 goto ret_object;
244 }
245
235 fle = kmem_cache_alloc(flow_cachep, GFP_ATOMIC); 246 fle = kmem_cache_alloc(flow_cachep, GFP_ATOMIC);
236 if (fle) { 247 if (fle) {
237 fle->net = net; 248 fle->net = net;
@@ -446,6 +457,7 @@ int flow_cache_init(struct net *net)
446 INIT_WORK(&net->xfrm.flow_cache_gc_work, flow_cache_gc_task); 457 INIT_WORK(&net->xfrm.flow_cache_gc_work, flow_cache_gc_task);
447 INIT_WORK(&net->xfrm.flow_cache_flush_work, flow_cache_flush_task); 458 INIT_WORK(&net->xfrm.flow_cache_flush_work, flow_cache_flush_task);
448 mutex_init(&net->xfrm.flow_flush_sem); 459 mutex_init(&net->xfrm.flow_flush_sem);
460 atomic_set(&net->xfrm.flow_cache_gc_count, 0);
449 461
450 fc->hash_shift = 10; 462 fc->hash_shift = 10;
451 fc->low_watermark = 2 * flow_cache_hash_size(fc); 463 fc->low_watermark = 2 * flow_cache_hash_size(fc);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index a75f7e94b445..65763c29f845 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1180,14 +1180,16 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
1180 1180
1181static int rtnl_fill_link_ifmap(struct sk_buff *skb, struct net_device *dev) 1181static int rtnl_fill_link_ifmap(struct sk_buff *skb, struct net_device *dev)
1182{ 1182{
1183 struct rtnl_link_ifmap map = { 1183 struct rtnl_link_ifmap map;
1184 .mem_start = dev->mem_start, 1184
1185 .mem_end = dev->mem_end, 1185 memset(&map, 0, sizeof(map));
1186 .base_addr = dev->base_addr, 1186 map.mem_start = dev->mem_start;
1187 .irq = dev->irq, 1187 map.mem_end = dev->mem_end;
1188 .dma = dev->dma, 1188 map.base_addr = dev->base_addr;
1189 .port = dev->if_port, 1189 map.irq = dev->irq;
1190 }; 1190 map.dma = dev->dma;
1191 map.port = dev->if_port;
1192
1191 if (nla_put(skb, IFLA_MAP, sizeof(map), &map)) 1193 if (nla_put(skb, IFLA_MAP, sizeof(map), &map))
1192 return -EMSGSIZE; 1194 return -EMSGSIZE;
1193 1195
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index d97268e8ff10..2b68418c7198 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -975,6 +975,8 @@ fib_convert_metrics(struct fib_info *fi, const struct fib_config *cfg)
975 val = 65535 - 40; 975 val = 65535 - 40;
976 if (type == RTAX_MTU && val > 65535 - 15) 976 if (type == RTAX_MTU && val > 65535 - 15)
977 val = 65535 - 15; 977 val = 65535 - 15;
978 if (type == RTAX_HOPLIMIT && val > 255)
979 val = 255;
978 if (type == RTAX_FEATURES && (val & ~RTAX_FEATURE_MASK)) 980 if (type == RTAX_FEATURES && (val & ~RTAX_FEATURE_MASK))
979 return -EINVAL; 981 return -EINVAL;
980 fi->fib_metrics[type - 1] = val; 982 fi->fib_metrics[type - 1] = val;
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index a39068b4a4d9..a6962ccad98a 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -228,8 +228,6 @@ static int fou_gro_complete(struct sk_buff *skb, int nhoff,
228 int err = -ENOSYS; 228 int err = -ENOSYS;
229 const struct net_offload **offloads; 229 const struct net_offload **offloads;
230 230
231 udp_tunnel_gro_complete(skb, nhoff);
232
233 rcu_read_lock(); 231 rcu_read_lock();
234 offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads; 232 offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads;
235 ops = rcu_dereference(offloads[proto]); 233 ops = rcu_dereference(offloads[proto]);
@@ -238,6 +236,8 @@ static int fou_gro_complete(struct sk_buff *skb, int nhoff,
238 236
239 err = ops->callbacks.gro_complete(skb, nhoff); 237 err = ops->callbacks.gro_complete(skb, nhoff);
240 238
239 skb_set_inner_mac_header(skb, nhoff);
240
241out_unlock: 241out_unlock:
242 rcu_read_unlock(); 242 rcu_read_unlock();
243 243
@@ -414,6 +414,8 @@ static int gue_gro_complete(struct sk_buff *skb, int nhoff,
414 414
415 err = ops->callbacks.gro_complete(skb, nhoff + guehlen); 415 err = ops->callbacks.gro_complete(skb, nhoff + guehlen);
416 416
417 skb_set_inner_mac_header(skb, nhoff + guehlen);
418
417out_unlock: 419out_unlock:
418 rcu_read_unlock(); 420 rcu_read_unlock();
419 return err; 421 return err;
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 205a2b8a5a84..4cc84212cce1 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -398,7 +398,10 @@ static int ipgre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi)
398 iph->saddr, iph->daddr, tpi->key); 398 iph->saddr, iph->daddr, tpi->key);
399 399
400 if (tunnel) { 400 if (tunnel) {
401 skb_pop_mac_header(skb); 401 if (tunnel->dev->type != ARPHRD_NONE)
402 skb_pop_mac_header(skb);
403 else
404 skb_reset_mac_header(skb);
402 if (tunnel->collect_md) { 405 if (tunnel->collect_md) {
403 __be16 flags; 406 __be16 flags;
404 __be64 tun_id; 407 __be64 tun_id;
@@ -1031,6 +1034,8 @@ static void ipgre_netlink_parms(struct net_device *dev,
1031 struct ip_tunnel *t = netdev_priv(dev); 1034 struct ip_tunnel *t = netdev_priv(dev);
1032 1035
1033 t->collect_md = true; 1036 t->collect_md = true;
1037 if (dev->type == ARPHRD_IPGRE)
1038 dev->type = ARPHRD_NONE;
1034 } 1039 }
1035} 1040}
1036 1041
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
index 5cf10b777b7e..a917903d5e97 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -156,6 +156,7 @@ static netdev_tx_t vti_xmit(struct sk_buff *skb, struct net_device *dev,
156 struct dst_entry *dst = skb_dst(skb); 156 struct dst_entry *dst = skb_dst(skb);
157 struct net_device *tdev; /* Device to other host */ 157 struct net_device *tdev; /* Device to other host */
158 int err; 158 int err;
159 int mtu;
159 160
160 if (!dst) { 161 if (!dst) {
161 dev->stats.tx_carrier_errors++; 162 dev->stats.tx_carrier_errors++;
@@ -192,6 +193,23 @@ static netdev_tx_t vti_xmit(struct sk_buff *skb, struct net_device *dev,
192 tunnel->err_count = 0; 193 tunnel->err_count = 0;
193 } 194 }
194 195
196 mtu = dst_mtu(dst);
197 if (skb->len > mtu) {
198 skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu);
199 if (skb->protocol == htons(ETH_P_IP)) {
200 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
201 htonl(mtu));
202 } else {
203 if (mtu < IPV6_MIN_MTU)
204 mtu = IPV6_MIN_MTU;
205
206 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
207 }
208
209 dst_release(dst);
210 goto tx_error;
211 }
212
195 skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(dev))); 213 skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(dev)));
196 skb_dst_set(skb, dst); 214 skb_dst_set(skb, dst);
197 skb->dev = skb_dst(skb)->dev; 215 skb->dev = skb_dst(skb)->dev;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 441ae9da3a23..79a03b87a771 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2640,8 +2640,10 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
2640 */ 2640 */
2641 if (unlikely((NET_IP_ALIGN && ((unsigned long)skb->data & 3)) || 2641 if (unlikely((NET_IP_ALIGN && ((unsigned long)skb->data & 3)) ||
2642 skb_headroom(skb) >= 0xFFFF)) { 2642 skb_headroom(skb) >= 0xFFFF)) {
2643 struct sk_buff *nskb = __pskb_copy(skb, MAX_TCP_HEADER, 2643 struct sk_buff *nskb;
2644 GFP_ATOMIC); 2644
2645 skb_mstamp_get(&skb->skb_mstamp);
2646 nskb = __pskb_copy(skb, MAX_TCP_HEADER, GFP_ATOMIC);
2645 err = nskb ? tcp_transmit_skb(sk, nskb, 0, GFP_ATOMIC) : 2647 err = nskb ? tcp_transmit_skb(sk, nskb, 0, GFP_ATOMIC) :
2646 -ENOBUFS; 2648 -ENOBUFS;
2647 } else { 2649 } else {
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 0ed2dafb7cc4..e330c0e56b11 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -399,6 +399,11 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff)
399 399
400 uh->len = newlen; 400 uh->len = newlen;
401 401
402 /* Set encapsulation before calling into inner gro_complete() functions
403 * to make them set up the inner offsets.
404 */
405 skb->encapsulation = 1;
406
402 rcu_read_lock(); 407 rcu_read_lock();
403 408
404 uo_priv = rcu_dereference(udp_offload_base); 409 uo_priv = rcu_dereference(udp_offload_base);
@@ -421,9 +426,6 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff)
421 if (skb->remcsum_offload) 426 if (skb->remcsum_offload)
422 skb_shinfo(skb)->gso_type |= SKB_GSO_TUNNEL_REMCSUM; 427 skb_shinfo(skb)->gso_type |= SKB_GSO_TUNNEL_REMCSUM;
423 428
424 skb->encapsulation = 1;
425 skb_set_inner_mac_header(skb, nhoff + sizeof(struct udphdr));
426
427 return err; 429 return err;
428} 430}
429 431
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 0a37ddc7af51..0013cacf7164 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -445,6 +445,8 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
445 445
446 if (__ipv6_addr_needs_scope_id(addr_type)) 446 if (__ipv6_addr_needs_scope_id(addr_type))
447 iif = skb->dev->ifindex; 447 iif = skb->dev->ifindex;
448 else
449 iif = l3mdev_master_ifindex(skb->dev);
448 450
449 /* 451 /*
450 * Must not send error if the source does not uniquely 452 * Must not send error if the source does not uniquely
@@ -499,9 +501,6 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
499 else if (!fl6.flowi6_oif) 501 else if (!fl6.flowi6_oif)
500 fl6.flowi6_oif = np->ucast_oif; 502 fl6.flowi6_oif = np->ucast_oif;
501 503
502 if (!fl6.flowi6_oif)
503 fl6.flowi6_oif = l3mdev_master_ifindex(skb->dev);
504
505 dst = icmpv6_route_lookup(net, skb, sk, &fl6); 504 dst = icmpv6_route_lookup(net, skb, sk, &fl6);
506 if (IS_ERR(dst)) 505 if (IS_ERR(dst))
507 goto out; 506 goto out;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index d916d6ab9ad2..6f32944e0223 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1750,6 +1750,8 @@ static int ip6_convert_metrics(struct mx6_config *mxc,
1750 } else { 1750 } else {
1751 val = nla_get_u32(nla); 1751 val = nla_get_u32(nla);
1752 } 1752 }
1753 if (type == RTAX_HOPLIMIT && val > 255)
1754 val = 255;
1753 if (type == RTAX_FEATURES && (val & ~RTAX_FEATURE_MASK)) 1755 if (type == RTAX_FEATURES && (val & ~RTAX_FEATURE_MASK))
1754 goto err; 1756 goto err;
1755 1757
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 711d209f9124..f443c6b0ce16 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -810,8 +810,13 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
810 fl6.flowi6_proto = IPPROTO_TCP; 810 fl6.flowi6_proto = IPPROTO_TCP;
811 if (rt6_need_strict(&fl6.daddr) && !oif) 811 if (rt6_need_strict(&fl6.daddr) && !oif)
812 fl6.flowi6_oif = tcp_v6_iif(skb); 812 fl6.flowi6_oif = tcp_v6_iif(skb);
813 else 813 else {
814 if (!oif && netif_index_is_l3_master(net, skb->skb_iif))
815 oif = skb->skb_iif;
816
814 fl6.flowi6_oif = oif; 817 fl6.flowi6_oif = oif;
818 }
819
815 fl6.flowi6_mark = IP6_REPLY_MARK(net, skb->mark); 820 fl6.flowi6_mark = IP6_REPLY_MARK(net, skb->mark);
816 fl6.fl6_dport = t1->dest; 821 fl6.fl6_dport = t1->dest;
817 fl6.fl6_sport = t1->source; 822 fl6.fl6_sport = t1->source;
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index b3c52e3f689a..8ae3ed97d95c 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -626,6 +626,7 @@ static void llc_cmsg_rcv(struct msghdr *msg, struct sk_buff *skb)
626 if (llc->cmsg_flags & LLC_CMSG_PKTINFO) { 626 if (llc->cmsg_flags & LLC_CMSG_PKTINFO) {
627 struct llc_pktinfo info; 627 struct llc_pktinfo info;
628 628
629 memset(&info, 0, sizeof(info));
629 info.lpi_ifindex = llc_sk(skb->sk)->dev->ifindex; 630 info.lpi_ifindex = llc_sk(skb->sk)->dev->ifindex;
630 llc_pdu_decode_dsap(skb, &info.lpi_sap); 631 llc_pdu_decode_dsap(skb, &info.lpi_sap);
631 llc_pdu_decode_da(skb, info.lpi_mac); 632 llc_pdu_decode_da(skb, info.lpi_mac);
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index afde5f5e728a..e27fd17c6743 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -66,7 +66,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_locks);
66__cacheline_aligned_in_smp DEFINE_SPINLOCK(nf_conntrack_expect_lock); 66__cacheline_aligned_in_smp DEFINE_SPINLOCK(nf_conntrack_expect_lock);
67EXPORT_SYMBOL_GPL(nf_conntrack_expect_lock); 67EXPORT_SYMBOL_GPL(nf_conntrack_expect_lock);
68 68
69static __read_mostly spinlock_t nf_conntrack_locks_all_lock; 69static __read_mostly DEFINE_SPINLOCK(nf_conntrack_locks_all_lock);
70static __read_mostly bool nf_conntrack_locks_all; 70static __read_mostly bool nf_conntrack_locks_all;
71 71
72void nf_conntrack_lock(spinlock_t *lock) __acquires(lock) 72void nf_conntrack_lock(spinlock_t *lock) __acquires(lock)
@@ -1778,6 +1778,7 @@ void nf_conntrack_init_end(void)
1778 1778
1779int nf_conntrack_init_net(struct net *net) 1779int nf_conntrack_init_net(struct net *net)
1780{ 1780{
1781 static atomic64_t unique_id;
1781 int ret = -ENOMEM; 1782 int ret = -ENOMEM;
1782 int cpu; 1783 int cpu;
1783 1784
@@ -1800,7 +1801,8 @@ int nf_conntrack_init_net(struct net *net)
1800 if (!net->ct.stat) 1801 if (!net->ct.stat)
1801 goto err_pcpu_lists; 1802 goto err_pcpu_lists;
1802 1803
1803 net->ct.slabname = kasprintf(GFP_KERNEL, "nf_conntrack_%p", net); 1804 net->ct.slabname = kasprintf(GFP_KERNEL, "nf_conntrack_%llu",
1805 (u64)atomic64_inc_return(&unique_id));
1804 if (!net->ct.slabname) 1806 if (!net->ct.slabname)
1805 goto err_slabname; 1807 goto err_slabname;
1806 1808
diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c
index 4c2b4c0c4d5f..dbd0803b1827 100644
--- a/net/netfilter/nfnetlink_acct.c
+++ b/net/netfilter/nfnetlink_acct.c
@@ -96,6 +96,8 @@ static int nfnl_acct_new(struct net *net, struct sock *nfnl,
96 return -EINVAL; 96 return -EINVAL;
97 if (flags & NFACCT_F_OVERQUOTA) 97 if (flags & NFACCT_F_OVERQUOTA)
98 return -EINVAL; 98 return -EINVAL;
99 if ((flags & NFACCT_F_QUOTA) && !tb[NFACCT_QUOTA])
100 return -EINVAL;
99 101
100 size += sizeof(u64); 102 size += sizeof(u64);
101 } 103 }
diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c
index 29d2c31f406c..daf45da448fa 100644
--- a/net/netfilter/xt_IDLETIMER.c
+++ b/net/netfilter/xt_IDLETIMER.c
@@ -236,6 +236,7 @@ static void idletimer_tg_destroy(const struct xt_tgdtor_param *par)
236 236
237 list_del(&info->timer->entry); 237 list_del(&info->timer->entry);
238 del_timer_sync(&info->timer->timer); 238 del_timer_sync(&info->timer->timer);
239 cancel_work_sync(&info->timer->work);
239 sysfs_remove_file(idletimer_tg_kobj, &info->timer->attr.attr); 240 sysfs_remove_file(idletimer_tg_kobj, &info->timer->attr.attr);
240 kfree(info->timer->attr.attr.name); 241 kfree(info->timer->attr.attr.name);
241 kfree(info->timer); 242 kfree(info->timer);
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index b5fea1101faa..10c84d882881 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -776,6 +776,19 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key,
776 return -EINVAL; 776 return -EINVAL;
777 } 777 }
778 778
779 /* Userspace may decide to perform a ct lookup without a helper
780 * specified followed by a (recirculate and) commit with one.
781 * Therefore, for unconfirmed connections which we will commit,
782 * we need to attach the helper here.
783 */
784 if (!nf_ct_is_confirmed(ct) && info->commit &&
785 info->helper && !nfct_help(ct)) {
786 int err = __nf_ct_try_assign_helper(ct, info->ct,
787 GFP_ATOMIC);
788 if (err)
789 return err;
790 }
791
779 /* Call the helper only if: 792 /* Call the helper only if:
780 * - nf_conntrack_in() was executed above ("!cached") for a 793 * - nf_conntrack_in() was executed above ("!cached") for a
781 * confirmed connection, or 794 * confirmed connection, or
diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
index c589a9ba506a..343d011aa818 100644
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -423,7 +423,7 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
423 u16 ife_type = 0; 423 u16 ife_type = 0;
424 u8 *daddr = NULL; 424 u8 *daddr = NULL;
425 u8 *saddr = NULL; 425 u8 *saddr = NULL;
426 int ret = 0; 426 int ret = 0, exists = 0;
427 int err; 427 int err;
428 428
429 err = nla_parse_nested(tb, TCA_IFE_MAX, nla, ife_policy); 429 err = nla_parse_nested(tb, TCA_IFE_MAX, nla, ife_policy);
@@ -435,25 +435,29 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
435 435
436 parm = nla_data(tb[TCA_IFE_PARMS]); 436 parm = nla_data(tb[TCA_IFE_PARMS]);
437 437
438 exists = tcf_hash_check(tn, parm->index, a, bind);
439 if (exists && bind)
440 return 0;
441
438 if (parm->flags & IFE_ENCODE) { 442 if (parm->flags & IFE_ENCODE) {
439 /* Until we get issued the ethertype, we cant have 443 /* Until we get issued the ethertype, we cant have
440 * a default.. 444 * a default..
441 **/ 445 **/
442 if (!tb[TCA_IFE_TYPE]) { 446 if (!tb[TCA_IFE_TYPE]) {
447 if (exists)
448 tcf_hash_release(a, bind);
443 pr_info("You MUST pass etherype for encoding\n"); 449 pr_info("You MUST pass etherype for encoding\n");
444 return -EINVAL; 450 return -EINVAL;
445 } 451 }
446 } 452 }
447 453
448 if (!tcf_hash_check(tn, parm->index, a, bind)) { 454 if (!exists) {
449 ret = tcf_hash_create(tn, parm->index, est, a, sizeof(*ife), 455 ret = tcf_hash_create(tn, parm->index, est, a, sizeof(*ife),
450 bind, false); 456 bind, false);
451 if (ret) 457 if (ret)
452 return ret; 458 return ret;
453 ret = ACT_P_CREATED; 459 ret = ACT_P_CREATED;
454 } else { 460 } else {
455 if (bind) /* dont override defaults */
456 return 0;
457 tcf_hash_release(a, bind); 461 tcf_hash_release(a, bind);
458 if (!ovr) 462 if (!ovr)
459 return -EEXIST; 463 return -EEXIST;
@@ -495,6 +499,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
495 NULL); 499 NULL);
496 if (err) { 500 if (err) {
497metadata_parse_err: 501metadata_parse_err:
502 if (exists)
503 tcf_hash_release(a, bind);
498 if (ret == ACT_P_CREATED) 504 if (ret == ACT_P_CREATED)
499 _tcf_ife_cleanup(a, bind); 505 _tcf_ife_cleanup(a, bind);
500 506
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 350e134cffb3..8b5270008a6e 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -96,7 +96,7 @@ static int __tcf_ipt_init(struct tc_action_net *tn, struct nlattr *nla,
96 struct tcf_ipt *ipt; 96 struct tcf_ipt *ipt;
97 struct xt_entry_target *td, *t; 97 struct xt_entry_target *td, *t;
98 char *tname; 98 char *tname;
99 int ret = 0, err; 99 int ret = 0, err, exists = 0;
100 u32 hook = 0; 100 u32 hook = 0;
101 u32 index = 0; 101 u32 index = 0;
102 102
@@ -107,18 +107,23 @@ static int __tcf_ipt_init(struct tc_action_net *tn, struct nlattr *nla,
107 if (err < 0) 107 if (err < 0)
108 return err; 108 return err;
109 109
110 if (tb[TCA_IPT_HOOK] == NULL) 110 if (tb[TCA_IPT_INDEX] != NULL)
111 return -EINVAL; 111 index = nla_get_u32(tb[TCA_IPT_INDEX]);
112 if (tb[TCA_IPT_TARG] == NULL) 112
113 exists = tcf_hash_check(tn, index, a, bind);
114 if (exists && bind)
115 return 0;
116
117 if (tb[TCA_IPT_HOOK] == NULL || tb[TCA_IPT_TARG] == NULL) {
118 if (exists)
119 tcf_hash_release(a, bind);
113 return -EINVAL; 120 return -EINVAL;
121 }
114 122
115 td = (struct xt_entry_target *)nla_data(tb[TCA_IPT_TARG]); 123 td = (struct xt_entry_target *)nla_data(tb[TCA_IPT_TARG]);
116 if (nla_len(tb[TCA_IPT_TARG]) < td->u.target_size) 124 if (nla_len(tb[TCA_IPT_TARG]) < td->u.target_size)
117 return -EINVAL; 125 return -EINVAL;
118 126
119 if (tb[TCA_IPT_INDEX] != NULL)
120 index = nla_get_u32(tb[TCA_IPT_INDEX]);
121
122 if (!tcf_hash_check(tn, index, a, bind)) { 127 if (!tcf_hash_check(tn, index, a, bind)) {
123 ret = tcf_hash_create(tn, index, est, a, sizeof(*ipt), bind, 128 ret = tcf_hash_create(tn, index, est, a, sizeof(*ipt), bind,
124 false); 129 false);
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index e8a760cf7775..8f3948dd38b8 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -61,7 +61,7 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
61 struct tc_mirred *parm; 61 struct tc_mirred *parm;
62 struct tcf_mirred *m; 62 struct tcf_mirred *m;
63 struct net_device *dev; 63 struct net_device *dev;
64 int ret, ok_push = 0; 64 int ret, ok_push = 0, exists = 0;
65 65
66 if (nla == NULL) 66 if (nla == NULL)
67 return -EINVAL; 67 return -EINVAL;
@@ -71,17 +71,27 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
71 if (tb[TCA_MIRRED_PARMS] == NULL) 71 if (tb[TCA_MIRRED_PARMS] == NULL)
72 return -EINVAL; 72 return -EINVAL;
73 parm = nla_data(tb[TCA_MIRRED_PARMS]); 73 parm = nla_data(tb[TCA_MIRRED_PARMS]);
74
75 exists = tcf_hash_check(tn, parm->index, a, bind);
76 if (exists && bind)
77 return 0;
78
74 switch (parm->eaction) { 79 switch (parm->eaction) {
75 case TCA_EGRESS_MIRROR: 80 case TCA_EGRESS_MIRROR:
76 case TCA_EGRESS_REDIR: 81 case TCA_EGRESS_REDIR:
77 break; 82 break;
78 default: 83 default:
84 if (exists)
85 tcf_hash_release(a, bind);
79 return -EINVAL; 86 return -EINVAL;
80 } 87 }
81 if (parm->ifindex) { 88 if (parm->ifindex) {
82 dev = __dev_get_by_index(net, parm->ifindex); 89 dev = __dev_get_by_index(net, parm->ifindex);
83 if (dev == NULL) 90 if (dev == NULL) {
91 if (exists)
92 tcf_hash_release(a, bind);
84 return -ENODEV; 93 return -ENODEV;
94 }
85 switch (dev->type) { 95 switch (dev->type) {
86 case ARPHRD_TUNNEL: 96 case ARPHRD_TUNNEL:
87 case ARPHRD_TUNNEL6: 97 case ARPHRD_TUNNEL6:
@@ -99,7 +109,7 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
99 dev = NULL; 109 dev = NULL;
100 } 110 }
101 111
102 if (!tcf_hash_check(tn, parm->index, a, bind)) { 112 if (!exists) {
103 if (dev == NULL) 113 if (dev == NULL)
104 return -EINVAL; 114 return -EINVAL;
105 ret = tcf_hash_create(tn, parm->index, est, a, 115 ret = tcf_hash_create(tn, parm->index, est, a,
@@ -108,9 +118,6 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
108 return ret; 118 return ret;
109 ret = ACT_P_CREATED; 119 ret = ACT_P_CREATED;
110 } else { 120 } else {
111 if (bind)
112 return 0;
113
114 tcf_hash_release(a, bind); 121 tcf_hash_release(a, bind);
115 if (!ovr) 122 if (!ovr)
116 return -EEXIST; 123 return -EEXIST;
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index 75b2be13fbcc..3a33fb648a6d 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -87,7 +87,7 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
87 struct tc_defact *parm; 87 struct tc_defact *parm;
88 struct tcf_defact *d; 88 struct tcf_defact *d;
89 char *defdata; 89 char *defdata;
90 int ret = 0, err; 90 int ret = 0, err, exists = 0;
91 91
92 if (nla == NULL) 92 if (nla == NULL)
93 return -EINVAL; 93 return -EINVAL;
@@ -99,13 +99,21 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
99 if (tb[TCA_DEF_PARMS] == NULL) 99 if (tb[TCA_DEF_PARMS] == NULL)
100 return -EINVAL; 100 return -EINVAL;
101 101
102 if (tb[TCA_DEF_DATA] == NULL)
103 return -EINVAL;
104 102
105 parm = nla_data(tb[TCA_DEF_PARMS]); 103 parm = nla_data(tb[TCA_DEF_PARMS]);
104 exists = tcf_hash_check(tn, parm->index, a, bind);
105 if (exists && bind)
106 return 0;
107
108 if (tb[TCA_DEF_DATA] == NULL) {
109 if (exists)
110 tcf_hash_release(a, bind);
111 return -EINVAL;
112 }
113
106 defdata = nla_data(tb[TCA_DEF_DATA]); 114 defdata = nla_data(tb[TCA_DEF_DATA]);
107 115
108 if (!tcf_hash_check(tn, parm->index, a, bind)) { 116 if (!exists) {
109 ret = tcf_hash_create(tn, parm->index, est, a, 117 ret = tcf_hash_create(tn, parm->index, est, a,
110 sizeof(*d), bind, false); 118 sizeof(*d), bind, false);
111 if (ret) 119 if (ret)
@@ -122,8 +130,6 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
122 } else { 130 } else {
123 d = to_defact(a); 131 d = to_defact(a);
124 132
125 if (bind)
126 return 0;
127 tcf_hash_release(a, bind); 133 tcf_hash_release(a, bind);
128 if (!ovr) 134 if (!ovr)
129 return -EEXIST; 135 return -EEXIST;
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
index cfcdbdc00c9b..69da5a8f0034 100644
--- a/net/sched/act_skbedit.c
+++ b/net/sched/act_skbedit.c
@@ -69,7 +69,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
69 struct tcf_skbedit *d; 69 struct tcf_skbedit *d;
70 u32 flags = 0, *priority = NULL, *mark = NULL; 70 u32 flags = 0, *priority = NULL, *mark = NULL;
71 u16 *queue_mapping = NULL; 71 u16 *queue_mapping = NULL;
72 int ret = 0, err; 72 int ret = 0, err, exists = 0;
73 73
74 if (nla == NULL) 74 if (nla == NULL)
75 return -EINVAL; 75 return -EINVAL;
@@ -96,12 +96,18 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
96 mark = nla_data(tb[TCA_SKBEDIT_MARK]); 96 mark = nla_data(tb[TCA_SKBEDIT_MARK]);
97 } 97 }
98 98
99 if (!flags)
100 return -EINVAL;
101
102 parm = nla_data(tb[TCA_SKBEDIT_PARMS]); 99 parm = nla_data(tb[TCA_SKBEDIT_PARMS]);
103 100
104 if (!tcf_hash_check(tn, parm->index, a, bind)) { 101 exists = tcf_hash_check(tn, parm->index, a, bind);
102 if (exists && bind)
103 return 0;
104
105 if (!flags) {
106 tcf_hash_release(a, bind);
107 return -EINVAL;
108 }
109
110 if (!exists) {
105 ret = tcf_hash_create(tn, parm->index, est, a, 111 ret = tcf_hash_create(tn, parm->index, est, a,
106 sizeof(*d), bind, false); 112 sizeof(*d), bind, false);
107 if (ret) 113 if (ret)
@@ -111,8 +117,6 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
111 ret = ACT_P_CREATED; 117 ret = ACT_P_CREATED;
112 } else { 118 } else {
113 d = to_skbedit(a); 119 d = to_skbedit(a);
114 if (bind)
115 return 0;
116 tcf_hash_release(a, bind); 120 tcf_hash_release(a, bind);
117 if (!ovr) 121 if (!ovr)
118 return -EEXIST; 122 return -EEXIST;
diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c
index bab8ae0cefc0..c45f926dafb9 100644
--- a/net/sched/act_vlan.c
+++ b/net/sched/act_vlan.c
@@ -77,7 +77,7 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla,
77 int action; 77 int action;
78 __be16 push_vid = 0; 78 __be16 push_vid = 0;
79 __be16 push_proto = 0; 79 __be16 push_proto = 0;
80 int ret = 0; 80 int ret = 0, exists = 0;
81 int err; 81 int err;
82 82
83 if (!nla) 83 if (!nla)
@@ -90,15 +90,25 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla,
90 if (!tb[TCA_VLAN_PARMS]) 90 if (!tb[TCA_VLAN_PARMS])
91 return -EINVAL; 91 return -EINVAL;
92 parm = nla_data(tb[TCA_VLAN_PARMS]); 92 parm = nla_data(tb[TCA_VLAN_PARMS]);
93 exists = tcf_hash_check(tn, parm->index, a, bind);
94 if (exists && bind)
95 return 0;
96
93 switch (parm->v_action) { 97 switch (parm->v_action) {
94 case TCA_VLAN_ACT_POP: 98 case TCA_VLAN_ACT_POP:
95 break; 99 break;
96 case TCA_VLAN_ACT_PUSH: 100 case TCA_VLAN_ACT_PUSH:
97 if (!tb[TCA_VLAN_PUSH_VLAN_ID]) 101 if (!tb[TCA_VLAN_PUSH_VLAN_ID]) {
102 if (exists)
103 tcf_hash_release(a, bind);
98 return -EINVAL; 104 return -EINVAL;
105 }
99 push_vid = nla_get_u16(tb[TCA_VLAN_PUSH_VLAN_ID]); 106 push_vid = nla_get_u16(tb[TCA_VLAN_PUSH_VLAN_ID]);
100 if (push_vid >= VLAN_VID_MASK) 107 if (push_vid >= VLAN_VID_MASK) {
108 if (exists)
109 tcf_hash_release(a, bind);
101 return -ERANGE; 110 return -ERANGE;
111 }
102 112
103 if (tb[TCA_VLAN_PUSH_VLAN_PROTOCOL]) { 113 if (tb[TCA_VLAN_PUSH_VLAN_PROTOCOL]) {
104 push_proto = nla_get_be16(tb[TCA_VLAN_PUSH_VLAN_PROTOCOL]); 114 push_proto = nla_get_be16(tb[TCA_VLAN_PUSH_VLAN_PROTOCOL]);
@@ -114,11 +124,13 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla,
114 } 124 }
115 break; 125 break;
116 default: 126 default:
127 if (exists)
128 tcf_hash_release(a, bind);
117 return -EINVAL; 129 return -EINVAL;
118 } 130 }
119 action = parm->v_action; 131 action = parm->v_action;
120 132
121 if (!tcf_hash_check(tn, parm->index, a, bind)) { 133 if (!exists) {
122 ret = tcf_hash_create(tn, parm->index, est, a, 134 ret = tcf_hash_create(tn, parm->index, est, a,
123 sizeof(*v), bind, false); 135 sizeof(*v), bind, false);
124 if (ret) 136 if (ret)
@@ -126,8 +138,6 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla,
126 138
127 ret = ACT_P_CREATED; 139 ret = ACT_P_CREATED;
128 } else { 140 } else {
129 if (bind)
130 return 0;
131 tcf_hash_release(a, bind); 141 tcf_hash_release(a, bind);
132 if (!ovr) 142 if (!ovr)
133 return -EEXIST; 143 return -EEXIST;
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 3dce53ebea92..b5f1221f48d4 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1808,27 +1808,8 @@ vsock_stream_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
1808 else if (sk->sk_shutdown & RCV_SHUTDOWN) 1808 else if (sk->sk_shutdown & RCV_SHUTDOWN)
1809 err = 0; 1809 err = 0;
1810 1810
1811 if (copied > 0) { 1811 if (copied > 0)
1812 /* We only do these additional bookkeeping/notification steps
1813 * if we actually copied something out of the queue pair
1814 * instead of just peeking ahead.
1815 */
1816
1817 if (!(flags & MSG_PEEK)) {
1818 /* If the other side has shutdown for sending and there
1819 * is nothing more to read, then modify the socket
1820 * state.
1821 */
1822 if (vsk->peer_shutdown & SEND_SHUTDOWN) {
1823 if (vsock_stream_has_data(vsk) <= 0) {
1824 sk->sk_state = SS_UNCONNECTED;
1825 sock_set_flag(sk, SOCK_DONE);
1826 sk->sk_state_change(sk);
1827 }
1828 }
1829 }
1830 err = copied; 1812 err = copied;
1831 }
1832 1813
1833out: 1814out:
1834 release_sock(sk); 1815 release_sock(sk);
diff --git a/net/x25/x25_facilities.c b/net/x25/x25_facilities.c
index 7ecd04c21360..997ff7b2509b 100644
--- a/net/x25/x25_facilities.c
+++ b/net/x25/x25_facilities.c
@@ -277,6 +277,7 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk,
277 277
278 memset(&theirs, 0, sizeof(theirs)); 278 memset(&theirs, 0, sizeof(theirs));
279 memcpy(new, ours, sizeof(*new)); 279 memcpy(new, ours, sizeof(*new));
280 memset(dte, 0, sizeof(*dte));
280 281
281 len = x25_parse_facilities(skb, &theirs, dte, &x25->vc_facil_mask); 282 len = x25_parse_facilities(skb, &theirs, dte, &x25->vc_facil_mask);
282 if (len < 0) 283 if (len < 0)
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index ff4a91fcab9f..637387bbaaea 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -99,6 +99,9 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
99 99
100 skb_dst_force(skb); 100 skb_dst_force(skb);
101 101
102 /* Inner headers are invalid now. */
103 skb->encapsulation = 0;
104
102 err = x->type->output(x, skb); 105 err = x->type->output(x, skb);
103 if (err == -EINPROGRESS) 106 if (err == -EINPROGRESS)
104 goto out; 107 goto out;