summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-03-30 20:44:42 +0200
committerThomas Haller <thaller@redhat.com>2023-04-04 08:43:21 +0200
commit25c97817d2ff4c62bacd46eade061d408eb50b20 (patch)
tree398bb09bb4d78d63326264b6f74e9826e9174a75
parentf7d321c6d6ab0eba1052163b114a5139b72c1889 (diff)
downloadNetworkManager-25c97817d2ff4c62bacd46eade061d408eb50b20.tar.gz
ovsdb: limit maxiumum data size for receive buffer from ovsdb
-rw-r--r--src/core/devices/ovs/nm-ovsdb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/devices/ovs/nm-ovsdb.c b/src/core/devices/ovs/nm-ovsdb.c
index 0e10aa2f0d..dc8bf289fe 100644
--- a/src/core/devices/ovs/nm-ovsdb.c
+++ b/src/core/devices/ovs/nm-ovsdb.c
@@ -2431,6 +2431,12 @@ again:
}
if (priv->input_buf.len > 0) {
+ if (priv->input_buf.len > 50 * 1024 * 1024) {
+ _LOGW("received too much data from ovsdb that is not valid JSON");
+ priv->num_failures++;
+ ovsdb_disconnect(self, priv->num_failures <= OVSDB_MAX_FAILURES, FALSE);
+ return;
+ }
/* We have an incomplete message in the message buffer. Don't wait for another round
* of "poll", instead try to read it again. */
goto again;