Merge ~chris.macnaughton/ubuntu/+source/openvswitch:ubuntu/cosmic into ~ubuntu-server-dev/ubuntu/+source/openvswitch:ubuntu/cosmic

Proposed by Chris MacNaughton
Status: Merged
Merged at revision: 1961306aa6854af03c79db320b02b298b86cff31
Proposed branch: ~chris.macnaughton/ubuntu/+source/openvswitch:ubuntu/cosmic
Merge into: ~ubuntu-server-dev/ubuntu/+source/openvswitch:ubuntu/cosmic
Diff against target: 178 lines (+150/-0)
4 files modified
debian/changelog (+19/-0)
debian/patches/0001-connmgr-Fix-vswitchd-abort-when-a-port-is-modified.patch (+93/-0)
debian/patches/0002-connmgr-Do-not-send-asynchronous-messages-to-rconns.patch (+36/-0)
debian/patches/series (+2/-0)
Reviewer Review Type Date Requested Status
Ubuntu Server Developers Pending
Review via email: mp+410731@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

I have built this package for the Rocky cloud archive in https://launchpad.net/~chris.macnaughton/+archive/ubuntu/bionic-rocky/+packages

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 6a7a2b8..09af28e 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,22 @@
6+openvswitch (2.10.0-0ubuntu3~cloud0) bionic-rocky; urgency=medium
7+
8+ * Don't send comms to remote connections still establishing
9+ which protocol to use (LP: #1923668)
10+ - d/p/0001-connmgr-Fix-vswitchd-abort-when-a-port-is-modified.patch:
11+ check connection status of remote connection before processing
12+ asynchronous message.
13+ - d/p/0002-connmgr-Do-not-send-asynchronous-messages-to-rconns.patch:
14+ check if openflow protocol has been determined before processing
15+ asynchronous message.
16+
17+ -- Billy Olsen <billy.olsen@canonical.com> Sun, 18 Apr 2021 19:43:18 -0700
18+
19+openvswitch (2.10.0-0ubuntu2~cloud0) bionic-rocky; urgency=medium
20+
21+ * New upstream release for the Ubuntu Cloud Archive.
22+
23+ -- Openstack Ubuntu Testing Bot <openstack-testing-bot@ubuntu.com> Thu, 30 Aug 2018 13:29:30 +0000
24+
25 openvswitch (2.10.0-0ubuntu2) cosmic; urgency=medium
26
27 * d/{openvswitch-switch,ovn-common}.install: Add missed scripts and
28diff --git a/debian/patches/0001-connmgr-Fix-vswitchd-abort-when-a-port-is-modified.patch b/debian/patches/0001-connmgr-Fix-vswitchd-abort-when-a-port-is-modified.patch
29new file mode 100644
30index 0000000..38ca517
31--- /dev/null
32+++ b/debian/patches/0001-connmgr-Fix-vswitchd-abort-when-a-port-is-modified.patch
33@@ -0,0 +1,93 @@
34+From 903f6c4f8a9bce51984435ca3990f2717c63f703 Mon Sep 17 00:00:00 2001
35+From: Numan Siddique <nusiddiq@redhat.com>
36+Date: Thu, 18 Oct 2018 16:47:05 +0530
37+Subject: [PATCH] connmgr: Fix vswitchd abort when a port is added and the
38+ controller is down
39+
40+We see the below trace when a port is added to a bridge and the configured
41+controller is down
42+
43+0x00007fb002f8b207 in raise () from /lib64/libc.so.6
44+0x00007fb002f8c8f8 in abort () from /lib64/libc.so.6
45+0x00007fb004953026 in ofputil_protocol_to_ofp_version () from /lib64/libopenvswitch-2.10.so.0
46+0x00007fb00494e38e in ofputil_encode_port_status () from /lib64/libopenvswitch-2.10.so.0
47+0x00007fb004ef1c5b in connmgr_send_port_status () from /lib64/libofproto-2.10.so.0
48+0x00007fb004efa9f4 in ofport_install () from /lib64/libofproto-2.10.so.0
49+0x00007fb004efbfb2 in update_port () from /lib64/libofproto-2.10.so.0
50+0x00007fb004efc7f9 in ofproto_port_add () from /lib64/libofproto-2.10.so.0
51+0x0000556d540a3f95 in bridge_add_ports__ ()
52+0x0000556d540a5a47 in bridge_reconfigure ()
53+0x0000556d540a9199 in bridge_run ()
54+0x0000556d540a02a5 in main ()
55+
56+The abort is because of ofputil_protocol_to_ofp_version() is called with invalid
57+protocol - OFPUTIL_P_NONE. Please see [1] for more details. Similar aborts are
58+seen as reported in [2].
59+
60+The commit [3] changed the behavior of the function rconn_get_version().
61+Before the commit [3], the function ofconn_receives_async_msg() would always
62+return false if the connection to the controller was down, since
63+rconn_get_version() used to return -1. This patch now checks the rconn
64+connection status in ofconn_receives_async_msg() and returns false if not
65+connected. This would avoid the aborts seen in the above stack trace.
66+
67+The issue can be reproduced by running the test added in this patch
68+without the fix.
69+
70+[1] - https://bugzilla.redhat.com/show_bug.cgi?id=1640045
71+[2] - https://bugzilla.redhat.com/show_bug.cgi?id=1637926
72+
73+[3] - 476d2551ab ("rconn: Introduce new invariant to fix assertion failure in corner case.")
74+
75+Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
76+Signed-off-by: Ben Pfaff <blp@ovn.org>
77+Acked-by: Eelco Chaudron <echaudro@redhat.com>
78+---
79+ ofproto/connmgr.c | 4 ++++
80+ tests/bridge.at | 21 +++++++++++++++++++++
81+ 2 files changed, 25 insertions(+)
82+
83+diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
84+index 50e0b8f991b..94312002499 100644
85+--- a/ofproto/connmgr.c
86++++ b/ofproto/connmgr.c
87+@@ -1538,6 +1538,10 @@ ofconn_receives_async_msg(const struct ofconn *ofconn,
88+ ovs_assert(reason < 32);
89+ ovs_assert((unsigned int) type < OAM_N_TYPES);
90+
91++ if (!rconn_is_connected(ofconn->rconn)) {
92++ return false;
93++ }
94++
95+ /* Keep the following code in sync with the documentation in the
96+ * "Asynchronous Messages" section in 'topics/design' */
97+
98+diff --git a/tests/bridge.at b/tests/bridge.at
99+index 1c361856329..ee398bdb1e1 100644
100+--- a/tests/bridge.at
101++++ b/tests/bridge.at
102+@@ -79,3 +79,24 @@ AT_CHECK([ovs-vsctl --columns=status list controller | dnl
103+ OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
104+ OVS_APP_EXIT_AND_WAIT([ovsdb-server])
105+ AT_CLEANUP
106++
107++AT_SETUP([bridge - add port after stopping controller])
108++OVS_VSWITCHD_START
109++
110++dnl Start ovs-testcontroller
111++ovs-testcontroller --detach punix:controller --pidfile=ovs-testcontroller.pid
112++OVS_WAIT_UNTIL([test -e controller])
113++
114++AT_CHECK([ovs-vsctl set-controller br0 unix:controller])
115++AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=internal], [0], [ignore])
116++AT_CHECK([ovs-appctl -t ovs-vswitchd version], [0], [ignore])
117++
118++# Now kill the ovs-testcontroller
119++kill `cat ovs-testcontroller.pid`
120++OVS_WAIT_UNTIL([! test -e controller])
121++AT_CHECK([ovs-vsctl --no-wait add-port br0 p2 -- set Interface p2 type=internal], [0], [ignore])
122++AT_CHECK([ovs-appctl -t ovs-vswitchd version], [0], [ignore])
123++
124++OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
125++OVS_APP_EXIT_AND_WAIT([ovsdb-server])
126++AT_CLEANUP
127diff --git a/debian/patches/0002-connmgr-Do-not-send-asynchronous-messages-to-rconns.patch b/debian/patches/0002-connmgr-Do-not-send-asynchronous-messages-to-rconns.patch
128new file mode 100644
129index 0000000..2e8b006
130--- /dev/null
131+++ b/debian/patches/0002-connmgr-Do-not-send-asynchronous-messages-to-rconns.patch
132@@ -0,0 +1,36 @@
133+From 30e699b7ec43cc70d0d20f0969a2714bfb78c7c8 Mon Sep 17 00:00:00 2001
134+From: Ben Pfaff <blp@ovn.org>
135+Date: Wed, 12 Dec 2018 12:28:34 -0800
136+Subject: [PATCH] connmgr: Do not send asynchronous messages to rconns lacking
137+ protocols.
138+
139+There are corner cases in which an rconn might not have a defined OpenFlow
140+protocol or version. These happen at connection startup, before the
141+protocol version has been negotiated, and can also happen when a connection
142+is being shut down. It's desirable to avoid these situations entirely,
143+but so far we haven't managed to do this. This commit avoids trying to
144+send messages to such connection, which is what really tends to get OVS in
145+trouble since there's no way to construct an OpenFlow message without
146+knowing what version of OpenFlow to use (with a few exceptions that don't
147+matter here).
148+
149+Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-December/047876.html
150+Reported-by: Josh Bailey <joshb@google.com>
151+Signed-off-by: Ben Pfaff <blp@ovn.org>
152+---
153+ ofproto/connmgr.c | 2 +-
154+ 1 file changed, 1 insertion(+), 1 deletion(-)
155+
156+diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
157+index a3f49a8ef2b..684f77c398a 100644
158+--- a/ofproto/connmgr.c
159++++ b/ofproto/connmgr.c
160+@@ -1517,7 +1517,7 @@ ofconn_receives_async_msg(const struct ofconn *ofconn,
161+ ovs_assert(reason < 32);
162+ ovs_assert((unsigned int) type < OAM_N_TYPES);
163+
164+- if (!rconn_is_connected(ofconn->rconn)) {
165++ if (!rconn_is_connected(ofconn->rconn) || !ofconn_get_protocol(ofconn)) {
166+ return false;
167+ }
168+
169diff --git a/debian/patches/series b/debian/patches/series
170index 9301bd1..a122b97 100644
171--- a/debian/patches/series
172+++ b/debian/patches/series
173@@ -1,3 +1,5 @@
174 py3-compat.patch
175 erspan-add-big-endian-bit-fields.patch
176 tests-Fix-hash-function-dependencies-in-tunnel-ERSPA.patch
177+0001-connmgr-Fix-vswitchd-abort-when-a-port-is-modified.patch
178+0002-connmgr-Do-not-send-asynchronous-messages-to-rconns.patch

Subscribers

People subscribed via source and target branches