ovs_dp_cmd_new()->ovs_dp_change()->ovs_dp_set_upcall_portids()
allocates array via kmalloc.
If for some reason new_vport() fails during ovs_dp_cmd_new()
dp->upcall_portids must be freed.
Add missing kfree.
Kmemleak example:
unreferenced object 0x88800c382500 (size 64):
comm "dump_state", pid
Revert our patch for openvswitch, apply the ones that got accepted
into mainstream:
https://lore.kernel.org/all/20220825020450.664147-1-andrey.zhadche...@virtuozzo.com/
Andrey Zhadchenko (4):
Revert "net: openvswitch: add capability to specify ifindex of new
links"
openvswitch: fix memory
CRIU is preserving ifindexes of net devices after restoration. However,
current Open vSwitch API does not allow to target ifindex, so we cannot
correctly restore OVS configuration.
Add new OVS_DP_ATTR_IFINDEX for OVS_DP_CMD_NEW and use it as desired
ifindex.
Use OVS_VPORT_ATTR_IFINDEX during OVS_V
CRIU needs OVS_DP_ATTR_PER_CPU_PIDS to checkpoint/restore newest
openvswitch versions.
Add pids to generic datapath reply. Limit exported pids amount to
nr_cpu_ids.
Signed-off-by: Andrey Zhadchenko
Acked-by: Christian Brauner (Microsoft)
Signed-off-by: Jakub Kicinski
(cherry picked from ms com
This reverts commit 757ebade1eec8c6a3d1a150c8bd6f564c939c058.
We should use the version upstream accepted
https://jira.vzint.dev/browse/PSBM-105844
Signed-off-by: Andrey Zhadchenko
---
net/openvswitch/datapath.c | 16 ++--
net/openvswitch/vport-internal_dev.c | 1 -
net/op