summaryrefslogtreecommitdiffstats
path: root/net/openvswitch/datapath.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-11-01 20:48:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-11-01 20:48:11 -0400
commit1204c70d9dcba31164f78ad5d8c88c42335d51f8 (patch)
treeacb4728a02f13a6c547518f22f0d60a5ef7eaeb1 /net/openvswitch/datapath.c
parent372bf6c1c8f9712e7765acad568a6d7ed4e8d6c0 (diff)
parentaeb1b85c340c54dc1d68ff96b02d439d6a4f7150 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Fix free/alloc races in batmanadv, from Sven Eckelmann. 2) Several leaks and other fixes in kTLS support of mlx5 driver, from Tariq Toukan. 3) BPF devmap_hash cost calculation can overflow on 32-bit, from Toke Høiland-Jørgensen. 4) Add an r8152 device ID, from Kazutoshi Noguchi. 5) Missing include in ipv6's addrconf.c, from Ben Dooks. 6) Use siphash in flow dissector, from Eric Dumazet. Attackers can easily infer the 32-bit secret otherwise etc. 7) Several netdevice nesting depth fixes from Taehee Yoo. 8) Fix several KCSAN reported errors, from Eric Dumazet. For example, when doing lockless skb_queue_empty() checks, and accessing sk_napi_id/sk_incoming_cpu lockless as well. 9) Fix jumbo packet handling in RXRPC, from David Howells. 10) Bump SOMAXCONN and tcp_max_syn_backlog values, from Eric Dumazet. 11) Fix DMA synchronization in gve driver, from Yangchun Fu. 12) Several bpf offload fixes, from Jakub Kicinski. 13) Fix sk_page_frag() recursion during memory reclaim, from Tejun Heo. 14) Fix ping latency during high traffic rates in hisilicon driver, from Jiangfent Xiao. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (146 commits) net: fix installing orphaned programs net: cls_bpf: fix NULL deref on offload filter removal selftests: bpf: Skip write only files in debugfs selftests: net: reuseport_dualstack: fix uninitalized parameter r8169: fix wrong PHY ID issue with RTL8168dp net: dsa: bcm_sf2: Fix IMP setup for port different than 8 net: phylink: Fix phylink_dbg() macro gve: Fixes DMA synchronization. inet: stop leaking jiffies on the wire ixgbe: Remove duplicate clear_bit() call Documentation: networking: device drivers: Remove stray asterisks e1000: fix memory leaks i40e: Fix receive buffer starvation for AF_XDP igb: Fix constant media auto sense switching when no cable is connected net: ethernet: arc: add the missed clk_disable_unprepare igb: Enable media autosense for the i350. igb/igc: Don't warn on fatal read failures when the device is removed tcp: increase tcp_max_syn_backlog max value net: increase SOMAXCONN to 4096 netdevsim: Fix use-after-free during device dismantle ...
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r--net/openvswitch/datapath.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index f30e406fbec5..d8c364d637b1 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1881,7 +1881,7 @@ static struct genl_family dp_datapath_genl_family __ro_after_init = {
1881/* Called with ovs_mutex or RCU read lock. */ 1881/* Called with ovs_mutex or RCU read lock. */
1882static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, 1882static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb,
1883 struct net *net, u32 portid, u32 seq, 1883 struct net *net, u32 portid, u32 seq,
1884 u32 flags, u8 cmd) 1884 u32 flags, u8 cmd, gfp_t gfp)
1885{ 1885{
1886 struct ovs_header *ovs_header; 1886 struct ovs_header *ovs_header;
1887 struct ovs_vport_stats vport_stats; 1887 struct ovs_vport_stats vport_stats;
@@ -1902,7 +1902,7 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb,
1902 goto nla_put_failure; 1902 goto nla_put_failure;
1903 1903
1904 if (!net_eq(net, dev_net(vport->dev))) { 1904 if (!net_eq(net, dev_net(vport->dev))) {
1905 int id = peernet2id_alloc(net, dev_net(vport->dev)); 1905 int id = peernet2id_alloc(net, dev_net(vport->dev), gfp);
1906 1906
1907 if (nla_put_s32(skb, OVS_VPORT_ATTR_NETNSID, id)) 1907 if (nla_put_s32(skb, OVS_VPORT_ATTR_NETNSID, id))
1908 goto nla_put_failure; 1908 goto nla_put_failure;
@@ -1943,11 +1943,12 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, struct net *net,
1943 struct sk_buff *skb; 1943 struct sk_buff *skb;
1944 int retval; 1944 int retval;
1945 1945
1946 skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); 1946 skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
1947 if (!skb) 1947 if (!skb)
1948 return ERR_PTR(-ENOMEM); 1948 return ERR_PTR(-ENOMEM);
1949 1949
1950 retval = ovs_vport_cmd_fill_info(vport, skb, net, portid, seq, 0, cmd); 1950 retval = ovs_vport_cmd_fill_info(vport, skb, net, portid, seq, 0, cmd,
1951 GFP_KERNEL);
1951 BUG_ON(retval < 0); 1952 BUG_ON(retval < 0);
1952 1953
1953 return skb; 1954 return skb;
@@ -2089,7 +2090,7 @@ restart:
2089 2090
2090 err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), 2091 err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info),
2091 info->snd_portid, info->snd_seq, 0, 2092 info->snd_portid, info->snd_seq, 0,
2092 OVS_VPORT_CMD_NEW); 2093 OVS_VPORT_CMD_NEW, GFP_KERNEL);
2093 2094
2094 new_headroom = netdev_get_fwd_headroom(vport->dev); 2095 new_headroom = netdev_get_fwd_headroom(vport->dev);
2095 2096
@@ -2150,7 +2151,7 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
2150 2151
2151 err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), 2152 err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info),
2152 info->snd_portid, info->snd_seq, 0, 2153 info->snd_portid, info->snd_seq, 0,
2153 OVS_VPORT_CMD_SET); 2154 OVS_VPORT_CMD_SET, GFP_KERNEL);
2154 BUG_ON(err < 0); 2155 BUG_ON(err < 0);
2155 2156
2156 ovs_unlock(); 2157 ovs_unlock();
@@ -2190,7 +2191,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
2190 2191
2191 err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), 2192 err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info),
2192 info->snd_portid, info->snd_seq, 0, 2193 info->snd_portid, info->snd_seq, 0,
2193 OVS_VPORT_CMD_DEL); 2194 OVS_VPORT_CMD_DEL, GFP_KERNEL);
2194 BUG_ON(err < 0); 2195 BUG_ON(err < 0);
2195 2196
2196 /* the vport deletion may trigger dp headroom update */ 2197 /* the vport deletion may trigger dp headroom update */
@@ -2237,7 +2238,7 @@ static int ovs_vport_cmd_get(struct sk_buff *skb, struct genl_info *info)
2237 goto exit_unlock_free; 2238 goto exit_unlock_free;
2238 err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), 2239 err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info),
2239 info->snd_portid, info->snd_seq, 0, 2240 info->snd_portid, info->snd_seq, 0,
2240 OVS_VPORT_CMD_GET); 2241 OVS_VPORT_CMD_GET, GFP_ATOMIC);
2241 BUG_ON(err < 0); 2242 BUG_ON(err < 0);
2242 rcu_read_unlock(); 2243 rcu_read_unlock();
2243 2244
@@ -2273,7 +2274,8 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
2273 NETLINK_CB(cb->skb).portid, 2274 NETLINK_CB(cb->skb).portid,
2274 cb->nlh->nlmsg_seq, 2275 cb->nlh->nlmsg_seq,
2275 NLM_F_MULTI, 2276 NLM_F_MULTI,
2276 OVS_VPORT_CMD_GET) < 0) 2277 OVS_VPORT_CMD_GET,
2278 GFP_ATOMIC) < 0)
2277 goto out; 2279 goto out;
2278 2280
2279 j++; 2281 j++;