diff mbox series

[ovs-dev,v2,15/24] datapath: fix flow command message size

Message ID 20200909192021.9545-16-gvrose8192@gmail.com
State Superseded
Headers show
Series Add support for Linux kernels up to 5.8.x | expand

Commit Message

Gregory Rose Sept. 9, 2020, 7:20 p.m. UTC
From: Paolo Abeni <pabeni@redhat.com>

Upstream commit:
    commit 4e81c0b3fa93d07653e2415fa71656b080a112fd
    Author: Paolo Abeni <pabeni@redhat.com>
    Date:   Tue Nov 26 12:55:50 2019 +0100

    openvswitch: fix flow command message size

    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>

Cc: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/datapath.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

0-day Robot Sept. 9, 2020, 8:58 p.m. UTC | #1
Bleep bloop.  Greetings Greg Rose, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author Paolo Abeni <pabeni@redhat.com> needs to sign off.
WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Greg Rose <gvrose8192@gmail.com>
Lines checked: 52, Warnings: 1, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/datapath/datapath.c b/datapath/datapath.c
index b9ac67635..047b3312e 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -763,9 +763,13 @@  static size_t ovs_flow_cmd_msg_size(const struct sw_flow_actions *acts,
 {
 	size_t len = NLMSG_ALIGN(sizeof(struct ovs_header));
 
-	/* OVS_FLOW_ATTR_UFID */
+	/* OVS_FLOW_ATTR_UFID, or unmasked flow key as fallback
+	 * see ovs_nla_put_identifier()
+	 */
 	if (sfid && ovs_identifier_is_ufid(sfid))
 		len += nla_total_size(sfid->ufid_len);
+	else
+		len += nla_total_size(ovs_key_attr_size());
 
 	/* OVS_FLOW_ATTR_KEY */
 	if (!sfid || should_fill_key(sfid, ufid_flags))