From 3a8bf754e1256f415594a3c9c06826a5f13b1295 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 3 Jun 2014 15:53:23 +0200 Subject: [PATCH] vbox: workaround for bug in Windows guest addition In file src/VBox/Additions/WINNT/SharedFolders/driver/file.c the function static int vbsfTransferCommon(VBSFTRANSFERCTX *pCtx) in the VbglR0CanUsePhysPageList() branch does not correctly evaluate the read or written bytes from the VMM. It ever assumes that whole pages are read/written. Workaround the bug in the Windows guest additions of Vbox until fixed upstream by filling up the read/write buffer completely within the VMM code of Vbox. Fixes #1176 --- repos/ports/ports/virtualbox.hash | 2 +- .../virtualbox/sharedfolder_pagelist.patch | 87 +++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 repos/ports/src/virtualbox/sharedfolder_pagelist.patch diff --git a/repos/ports/ports/virtualbox.hash b/repos/ports/ports/virtualbox.hash index e80fc5f25a..8604adbb4d 100644 --- a/repos/ports/ports/virtualbox.hash +++ b/repos/ports/ports/virtualbox.hash @@ -1 +1 @@ -d2830608e86c55d6124ac016dae652fa6a69ea3e +13aca05c49d35f7ce7a2cfd25d2751d9d6de9019 diff --git a/repos/ports/src/virtualbox/sharedfolder_pagelist.patch b/repos/ports/src/virtualbox/sharedfolder_pagelist.patch new file mode 100644 index 0000000000..a6e2ae6074 --- /dev/null +++ b/repos/ports/src/virtualbox/sharedfolder_pagelist.patch @@ -0,0 +1,87 @@ ++++ src/app/virtualbox/src/VBox/HostServices/SharedFolders/service.cpp +@@ -546,6 +546,14 @@ + } + else + { ++ ++ ++ /* WORKAROUND start */ ++ uint32_t read = 0; ++ ++ while (paParms[3].u.uint32 && read < paParms[3].u.uint32) { ++ ++ + /* Execute the function. */ + if (pStatusLed) + { +@@ -559,13 +567,25 @@ + + if (RT_SUCCESS(rc)) + { ++ read += count; ++ offset += count; ++ pBuffer += count; ++ count = paParms[3].u.uint32 - read; ++ + /* Update parameters.*/ +- paParms[3].u.uint32 = count; ++ //paParms[3].u.uint32 = count; + } + else + { + paParms[3].u.uint32 = 0; /* nothing read */ + } ++ ++ ++ ++ } /* WORKAROUND - End */ ++ ++ ++ + } + } + break; +@@ -613,6 +633,16 @@ + } + else + { ++ ++ ++ ++ /* WORKAROUND start */ ++ uint32_t write = 0; ++ ++ while (paParms[3].u.uint32 && write < paParms[3].u.uint32) { ++ ++ ++ + /* Execute the function. */ + if (pStatusLed) + { +@@ -626,13 +656,25 @@ + + if (RT_SUCCESS(rc)) + { ++ write += count; ++ offset += count; ++ pBuffer += count; ++ count = paParms[3].u.uint32 - write; ++ + /* Update parameters.*/ +- paParms[3].u.uint32 = count; ++ //paParms[3].u.uint32 = count; + } + else + { + paParms[3].u.uint32 = 0; /* nothing read */ + } ++ ++ ++ ++ } /* WORKAROUND - End */ ++ ++ ++ + } + } + break;