[libvirt] [PATCH 2/2] rpc: Size up RPC limits

Michal Privoznik mprivozn at redhat.com
Fri Apr 27 13:22:45 UTC 2012


Since we are allocating RPC buffer dynamically, we can increase limits
for max. size of RPC message and RPC string. This is needed to cover
some corner cases where libvirt is run on such huge machines that their
capabilities XML is 4 times bigger than our current limit. This leaves
users with inability to even connect.
---
 src/remote/remote_protocol.x |    2 +-
 src/rpc/virnetprotocol.x     |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 2d57247..a89a757 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -65,7 +65,7 @@
  * This is an arbitrary limit designed to stop the decoder from trying
  * to allocate unbounded amounts of memory when fed with a bad message.
  */
-const REMOTE_STRING_MAX = 65536;
+const REMOTE_STRING_MAX = 1048576;
 
 /* A long string, which may NOT be NULL. */
 typedef string remote_nonnull_string<REMOTE_STRING_MAX>;
diff --git a/src/rpc/virnetprotocol.x b/src/rpc/virnetprotocol.x
index 4520e38..9663ddb 100644
--- a/src/rpc/virnetprotocol.x
+++ b/src/rpc/virnetprotocol.x
@@ -45,13 +45,13 @@
 /*----- Data types. -----*/
 
 /* Maximum total message size (serialised). */
-const VIR_NET_MESSAGE_MAX = 262144;
+const VIR_NET_MESSAGE_MAX = 4194304;
 
 /* Size of struct virNetMessageHeader (serialised)*/
 const VIR_NET_MESSAGE_HEADER_MAX = 24;
 
 /* Size of message payload */
-const VIR_NET_MESSAGE_PAYLOAD_MAX = 262120;
+const VIR_NET_MESSAGE_PAYLOAD_MAX = 4194280;
 
 /* Size of message length field. Not counted in VIR_NET_MESSAGE_MAX */
 const VIR_NET_MESSAGE_LEN_MAX = 4;
@@ -60,7 +60,7 @@ const VIR_NET_MESSAGE_LEN_MAX = 4;
  * This is an arbitrary limit designed to stop the decoder from trying
  * to allocate unbounded amounts of memory when fed with a bad message.
  */
-const VIR_NET_MESSAGE_STRING_MAX = 65536;
+const VIR_NET_MESSAGE_STRING_MAX = 1048576;
 
 /* Limit on number of File Descriptors allowed to be
  * passed per message
-- 
1.7.8.5




More information about the libvir-list mailing list