Index: /trunk/include/VBox/HostServices/GuestControlSvc.h
===================================================================
--- /trunk/include/VBox/HostServices/GuestControlSvc.h	(revision 84242)
+++ /trunk/include/VBox/HostServices/GuestControlSvc.h	(revision 84243)
@@ -696,4 +696,7 @@
  * @since 6.1.6  */
 #define VBOX_GUESTCTRL_GF_0_PROCESS_ARGV0           RT_BIT_64(1)
+/** Supports passing cmd / arguments / environment blocks bigger than
+ *  GUESTPROCESS_DEFAULT_CMD_LEN / GUESTPROCESS_DEFAULT_ARGS_LEN / GUESTPROCESS_DEFAULT_ENV_LEN (bytes, in total). */
+#define VBOX_GUESTCTRL_GF_0_PROCESS_DYNAMIC_SIZES   RT_BIT_64(2)
 /** Bit that must be set in the 2nd parameter, will be cleared if the host reponds
  * correctly (old hosts might not). */
Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp	(revision 84242)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp	(revision 84243)
@@ -246,5 +246,6 @@
          */
         const uint64_t fGuestFeatures = VBOX_GUESTCTRL_GF_0_SET_SIZE
-                                      | VBOX_GUESTCTRL_GF_0_PROCESS_ARGV0;
+                                      | VBOX_GUESTCTRL_GF_0_PROCESS_ARGV0
+                                      | VBOX_GUESTCTRL_GF_0_PROCESS_DYNAMIC_SIZES;
 
         rc = VbglR3GuestCtrlReportFeatures(g_idControlSvcClient, fGuestFeatures, &g_fControlHostFeatures0);
Index: /trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp	(revision 84242)
+++ /trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp	(revision 84243)
@@ -1058,5 +1058,4 @@
     const GuestCredentials &sessionCreds = pSession->i_getCredentials();
 
-
     /* Prepare arguments. */
     size_t cArgs = mData.mProcess.mArguments.size();
@@ -1064,4 +1063,15 @@
         return VERR_BUFFER_OVERFLOW;
 
+    Guest *pGuest = mSession->i_getParent();
+    AssertPtr(pGuest);
+
+    const uint64_t fGuestControlFeatures0 = pGuest->i_getGuestControlFeatures0();
+
+    /* If the guest does not support dynamic sizes, make sure that we check limits here. */
+    if (   !(fGuestControlFeatures0 & VBOX_GUESTCTRL_GF_0_PROCESS_DYNAMIC_SIZES)
+        &&  mData.mProcess.mExecutable.length() + 1 /* Include termination */ > GUESTPROCESS_DEFAULT_CMD_LEN)
+        return VERR_BUFFER_OVERFLOW;
+
+    size_t cbArgs = 0;
     char *pszArgs = NULL;
     int vrc = VINF_SUCCESS;
@@ -1077,9 +1087,4 @@
         }
         papszArgv[cArgs] = NULL;
-
-        Guest *pGuest = mSession->i_getParent();
-        AssertPtr(pGuest);
-
-        const uint64_t fGuestControlFeatures0 = pGuest->i_getGuestControlFeatures0();
 
         /* If the Guest Additions don't support using argv[0] correctly (< 6.1.x), don't supply it. */
@@ -1093,14 +1098,31 @@
             return vrc;
 
-        /* Note! No returns after this. */
-    }
-
-    /* Calculate arguments size (in bytes). */
-    size_t cbArgs = pszArgs ? strlen(pszArgs) + 1 : 0; /* Include terminating zero. */
+        /* Note! No direct returns after this. */
+
+        /* Calculate arguments size (in bytes). */
+        AssertPtr(pszArgs);
+        cbArgs = strlen(pszArgs) + 1; /* Include terminating zero. */
+
+        /* If the guest does not support dynamic sizes, make sure that we check limits here. */
+        if (   !(fGuestControlFeatures0 & VBOX_GUESTCTRL_GF_0_PROCESS_DYNAMIC_SIZES)
+            && cbArgs > GUESTPROCESS_DEFAULT_ARGS_LEN)
+        {
+            vrc = VERR_BUFFER_OVERFLOW;
+        }
+    }
 
     /* Prepare environment.  The guest service dislikes the empty string at the end, so drop it. */
     size_t  cbEnvBlock;
     char   *pszzEnvBlock;
-    vrc = mData.mProcess.mEnvironmentChanges.queryUtf8Block(&pszzEnvBlock, &cbEnvBlock);
+    if (RT_SUCCESS(vrc))
+        vrc = mData.mProcess.mEnvironmentChanges.queryUtf8Block(&pszzEnvBlock, &cbEnvBlock);
+    if (RT_SUCCESS(vrc))
+    {
+        /* If the guest does not support dynamic sizes, make sure that we check limits here. */
+        if (   !(fGuestControlFeatures0 & VBOX_GUESTCTRL_GF_0_PROCESS_DYNAMIC_SIZES)
+            && cbEnvBlock > GUESTPROCESS_DEFAULT_ENV_LEN)
+            vrc = VERR_BUFFER_OVERFLOW;
+    }
+
     if (RT_SUCCESS(vrc))
     {
