net: openvswitch: release vport resources on failure
authorAaron Conole <aconole@redhat.com>
Tue, 20 Dec 2022 21:27:17 +0000 (16:27 -0500)
committerJakub Kicinski <kuba@kernel.org>
Thu, 22 Dec 2022 01:48:12 +0000 (17:48 -0800)
commit95637d91fefdb94d6e7389222ba9ddab0e9f5abe
tree693a4ce55280a7a1108b518fc68d7d1b4fcad492
parentf2575c8f404911da83f25b688e12afcf4273e640
net: openvswitch: release vport resources on failure

A recent commit introducing upcall packet accounting failed to properly
release the vport object when the per-cpu stats struct couldn't be
allocated.  This can cause dangling pointers to dp objects long after
they've been released.

Cc: wangchuanlei <wangchuanlei@inspur.com>
Fixes: 1933ea365aa7 ("net: openvswitch: Add support to count upcall packets")
Reported-by: syzbot+8f4e2dcfcb3209ac35f9@syzkaller.appspotmail.com
Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://lore.kernel.org/r/20221220212717.526780-1-aconole@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/openvswitch/datapath.c