Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec
Steffen Klassert says: ==================== pull request (net): ipsec 2020-03-27 1) Handle NETDEV_UNREGISTER for xfrm device to handle asynchronous unregister events cleanly. From Raed Salem. 2) Fix vti6 tunnel inter address family TX through bpf_redirect(). From Nicolas Dichtel. 3) Fix lenght check in verify_sec_ctx_len() to avoid a slab-out-of-bounds. From Xin Long. 4) Add a missing verify_sec_ctx_len check in xfrm_add_acquire to avoid a possible out-of-bounds to access. From Xin Long. 5) Use built-in RCU list checking of hlist_for_each_entry_rcu to silence false lockdep warning in __xfrm6_tunnel_spi_lookup when CONFIG_PROVE_RCU_LIST is enabled. From Madhuparna Bhowmik. 6) Fix a panic on esp offload when crypto is done asynchronously. From Xin Long. 7) Fix a skb memory leak in an error path of vti6_rcv. From Torsten Hilbrich. 8) Fix a race that can lead to a doulbe free in xfrm_policy_timer. From Xin Long. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -303,6 +303,7 @@ config SYN_COOKIES
|
||||
|
||||
config NET_IPVTI
|
||||
tristate "Virtual (secure) IP: tunneling"
|
||||
depends on IPV6 || IPV6=n
|
||||
select INET_TUNNEL
|
||||
select NET_IP_TUNNEL
|
||||
select XFRM
|
||||
|
@@ -187,17 +187,39 @@ static netdev_tx_t vti_xmit(struct sk_buff *skb, struct net_device *dev,
|
||||
int mtu;
|
||||
|
||||
if (!dst) {
|
||||
struct rtable *rt;
|
||||
switch (skb->protocol) {
|
||||
case htons(ETH_P_IP): {
|
||||
struct rtable *rt;
|
||||
|
||||
fl->u.ip4.flowi4_oif = dev->ifindex;
|
||||
fl->u.ip4.flowi4_flags |= FLOWI_FLAG_ANYSRC;
|
||||
rt = __ip_route_output_key(dev_net(dev), &fl->u.ip4);
|
||||
if (IS_ERR(rt)) {
|
||||
fl->u.ip4.flowi4_oif = dev->ifindex;
|
||||
fl->u.ip4.flowi4_flags |= FLOWI_FLAG_ANYSRC;
|
||||
rt = __ip_route_output_key(dev_net(dev), &fl->u.ip4);
|
||||
if (IS_ERR(rt)) {
|
||||
dev->stats.tx_carrier_errors++;
|
||||
goto tx_error_icmp;
|
||||
}
|
||||
dst = &rt->dst;
|
||||
skb_dst_set(skb, dst);
|
||||
break;
|
||||
}
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
case htons(ETH_P_IPV6):
|
||||
fl->u.ip6.flowi6_oif = dev->ifindex;
|
||||
fl->u.ip6.flowi6_flags |= FLOWI_FLAG_ANYSRC;
|
||||
dst = ip6_route_output(dev_net(dev), NULL, &fl->u.ip6);
|
||||
if (dst->error) {
|
||||
dst_release(dst);
|
||||
dst = NULL;
|
||||
dev->stats.tx_carrier_errors++;
|
||||
goto tx_error_icmp;
|
||||
}
|
||||
skb_dst_set(skb, dst);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
dev->stats.tx_carrier_errors++;
|
||||
goto tx_error_icmp;
|
||||
}
|
||||
dst = &rt->dst;
|
||||
skb_dst_set(skb, dst);
|
||||
}
|
||||
|
||||
dst_hold(dst);
|
||||
|
Reference in New Issue
Block a user