openvswitch: fix flow command message size
authorPaolo Abeni <pabeni@redhat.com>
Tue, 26 Nov 2019 11:55:50 +0000 (12:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:35:26 +0000 (15:35 +0100)
commitb07c0629b4e5433e0ebc776f749105a82eecdb14
treee9dae3e6ac300ad343703f7ca79fd1fc056bf9c4
parentcb07e9c7c41f6ec0140af96e5a2a3424317d17d9
openvswitch: fix flow command message size

[ Upstream commit 4e81c0b3fa93d07653e2415fa71656b080a112fd ]

When user-space sets the OVS_UFID_F_OMIT_* flags, and the relevant
flow has no UFID, we can exceed the computed size, as
ovs_nla_put_identifier() will always dump an OVS_FLOW_ATTR_KEY
attribute.
Take the above in account when computing the flow command message
size.

Fixes: 74ed7ab9264c ("openvswitch: Add support for unique flow IDs.")
Reported-by: Qi Jun Ding <qding@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/openvswitch/datapath.c