Skip to contentSkip to conversation

QGA installer fixes

PATCH Superseded Konstantin Kostiuk 5 participants 9 messages Feb 20, 2023 – Feb 21, 2023

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover QGA installer fixes

Konstantin Kostiuk (2):
qga/win32: Remove change action from MSI installer qga/win32: Use rundll for VSS installation

 qga/installer/qemu-ga.wxs | 11 ++++++-----
 qga/vss-win32/install.cpp |  9 +++++++++
 qga/vss-win32/qga-vss.def |  2 ++
 3 files changed, 17 insertions(+), 5 deletions(-)

--
2.25.1

#1 lore raw

PATCH 1/2 qga/win32: Remove change action from MSI installer

resolves: rhbz#2167436
fixes: CVE-2023-0664

---
 qga/installer/qemu-ga.wxs | 1 +
 1 file changed, 1 insertion(+)
qga/installer/qemu-ga.wxs +1 -0
index 51340f7ecc..feb629ec47 100644
@@ -31,6 +31,7 @@
       />
     <Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab" EmbedCab="yes" />
     <Property Id="WHSLogo">1</Property>
+    <Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
     <MajorUpgrade
       DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
       />

--
2.25.1

Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] qga/win32: Remove change action from MSI installer

Quoted 24 lines · Konstantin Kostiuk

resolves: rhbz#2167436
fixes: CVE-2023-0664

---
 qga/installer/qemu-ga.wxs | 1 +
 1 file changed, 1 insertion(+)
qga/installer/qemu-ga.wxs +1 -1
index 51340f7ecc..feb629ec47 100644
@@ -31,6 +31,7 @@
       />
     <Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab" EmbedCab="yes" />
     <Property Id="WHSLogo">1</Property>
+    <Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
     <MajorUpgrade
       DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
       />
--

2.25.1

#3 lore raw

Re: [PATCH 1/2] qga/win32: Remove change action from MSI installer

In reply to Konstantin Kostiuk
Quoted 1 line · Konstantin Kostiuk

resolves: rhbz#2167436

"You are not authorized to access bug #2167436."

Quoted 1 line
Fixes CVE-2023-0664

This commit description is rather scarce...

I understand you are trying to fix a CVE, but we shouldn't play the "security by obscurity" card. How can the community and distributions know this security fix is enough with the bare "Remove change action from MSI installer" justification? Can't we do better?

Quoted 21 lines
---
  qga/installer/qemu-ga.wxs | 1 +
  1 file changed, 1 insertion(+)
qga/installer/qemu-ga.wxs +1 -1
index 51340f7ecc..feb629ec47 100644
@@ -31,6 +31,7 @@
        />
      <Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab" EmbedCab="yes" />
      <Property Id="WHSLogo">1</Property>
+    <Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
      <MajorUpgrade
        DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
        />
--

2.25.1

#4 lore raw

Re: [PATCH 1/2] qga/win32: Remove change action from MSI installer

Hi Philippe,

Quoted 5 lines · Philippe Mathieu-Daudé
Quoted 1 line · Konstantin Kostiuk

resolves: rhbz#2167436

"You are not authorized to access bug #2167436."

Please refer to https://bugzilla.redhat.com/show_bug.cgi?id=2167423.
It should now be accessible.

Quoted 9 lines
Quoted 1 line
Fixes CVE-2023-0664

This commit description is rather scarce...

I understand you are trying to fix a CVE, but we shouldn't play the "security by obscurity" card. How can the community and distributions know this security fix is enough with the bare "Remove change action from MSI installer" justification? Can't we do better?

CCing Brian Wiltse, who originally found and reported this issue.

Quoted 22 lines
Quoted 21 lines
---
  qga/installer/qemu-ga.wxs | 1 +
  1 file changed, 1 insertion(+)
qga/installer/qemu-ga.wxs +1 -1
index 51340f7ecc..feb629ec47 100644
@@ -31,6 +31,7 @@
        />
      <Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab" EmbedCab="yes" />
      <Property Id="WHSLogo">1</Property>
+    <Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
      <MajorUpgrade
        DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
        />
--

2.25.1

Signature · 3 lines
Mauro Matteo Cascella
Red Hat Product Security
PGP-Key ID: BB3410B0
#5 lore raw

Re: [PATCH 1/2] qga/win32: Remove change action from MSI installer

In reply to Philippe Mathieu-Daudé
Quoted 7 lines · Philippe Mathieu-Daudé
Quoted 1 line · Konstantin Kostiuk

resolves: rhbz#2167436

"You are not authorized to access bug #2167436."

Quoted 1 line
Fixes CVE-2023-0664
Quoted 8 lines

This commit description is rather scarce...

I understand you are trying to fix a CVE, but we shouldn't play the "security by obscurity" card. How can the community and distributions know this security fix is enough with the bare "Remove change action from MSI installer" justification? Can't we do better?

This patch is part of the fix. I remove the 'change' button because the installer has no components to choose from and the installer always installs everything.

The second patch removes the interactive command shell.

Quoted 26 lines

qga/installer/qemu-ga.wxs line 32

Quoted 13 lines
---
  qga/installer/qemu-ga.wxs | 1 +
  1 file changed, 1 insertion(+)
qga/installer/qemu-ga.wxs +0 -0
index 51340f7ecc..feb629ec47 100644
@@ -31,6 +31,7 @@
        />
      <Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab"

EmbedCab="yes" />

qga/installer/qemu-ga.wxs

Quoted 4 lines
qga/installer/qemu-ga.wxs +1 -0
      <Property Id="WHSLogo">1</Property>
+    <Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
      <MajorUpgrade
        DowngradeErrorMessage="Error: A newer version of QEMU guest

agent is already installed."

Quoted 5 lines
qga/installer/qemu-ga.wxs +0 -1
        />
--

2.25.1

#6 lore raw

Re: [PATCH 1/2] qga/win32: Remove change action from MSI installer

In reply to Philippe Mathieu-Daudé
Quoted 7 lines · Philippe Mathieu-Daudé
Quoted 1 line · Konstantin Kostiuk

resolves: rhbz#2167436

"You are not authorized to access bug #2167436."

Quoted 1 line
Fixes CVE-2023-0664
Quoted 7 lines

This commit description is rather scarce...

I understand you are trying to fix a CVE, but we shouldn't play the "security by obscurity" card. How can the community and distributions know this security fix is enough with the bare "Remove change action from MSI installer" justification? Can't we do better?

Yes, commit messages should always describe the problem being solved directly. Bug trackers usually make people wade through piles of irrelevant comments & potentially misleading blind alleys during the back & forth of triage. The important info needs to be distilled down and put in the commit message, concisely describing the problem faced. Bug tracker links have been known to bit-rot too.

The commit message needs to focus on /why/ the change was made, much more than describing /what/ was changed.

Quoted 5 lines
Quoted 5 lines
---
  qga/installer/qemu-ga.wxs | 1 +
  1 file changed, 1 insertion(+)
Quoted 12 lines

qga/installer/qemu-ga.wxs line 37

Quoted 12 lines
qga/installer/qemu-ga.wxs +1 -0
index 51340f7ecc..feb629ec47 100644
@@ -31,6 +31,7 @@
        />
      <Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab" EmbedCab="yes" />
      <Property Id="WHSLogo">1</Property>
+    <Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
      <MajorUpgrade
        DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
        />

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#7 lore raw

PATCH 2/2 qga/win32: Use rundll for VSS installation

In reply to Konstantin Kostiuk

Add specific an entry points for rundll which is just a wrapper for COMRegister/COMUnregister functions.

resolves: rhbz#2167436
fixes: CVE-2023-0664

---
 qga/installer/qemu-ga.wxs | 10 +++++-----
 qga/vss-win32/install.cpp |  9 +++++++++
 qga/vss-win32/qga-vss.def |  2 ++
 3 files changed, 16 insertions(+), 5 deletions(-)
qga/installer/qemu-ga.wxs +5 -5
index feb629ec47..46ae9e7a13 100644
@@ -127,22 +127,22 @@
       </Directory>
     </Directory>
 
-    <Property Id="cmd" Value="cmd.exe"/>
+    <Property Id="rundll" Value="rundll32.exe"/>
     <Property Id="REINSTALLMODE" Value="amus"/>
 
     <?ifdef var.InstallVss?>
     <CustomAction Id="RegisterCom"
-              ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-install'
+              ExeCommand='"[qemu_ga_directory]qga-vss.dll",DLLCOMRegister'
               Execute="deferred"
-              Property="cmd"
+              Property="rundll"
               Impersonate="no"
               Return="check"
               >
     </CustomAction>
     <CustomAction Id="UnRegisterCom"
-              ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-uninstall'
+              ExeCommand='"[qemu_ga_directory]qga-vss.dll",DLLCOMUnregister'
               Execute="deferred"
-              Property="cmd"
+              Property="rundll"
               Impersonate="no"
               Return="check"
               >
qga/vss-win32/install.cpp +9 -0
index b57508fbe0..68662a6dfc 100644
@@ -357,6 +357,15 @@ out:
     return hr;
 }
 
+STDAPI_(void) CALLBACK DLLCOMRegister(HWND, HINSTANCE, LPSTR, int)
+{
+    COMRegister();
+}
+
+STDAPI_(void) CALLBACK DLLCOMUnregister(HWND, HINSTANCE, LPSTR, int)
+{
+    COMUnregister();
+}
 
 static BOOL CreateRegistryKey(LPCTSTR key, LPCTSTR value, LPCTSTR data)
 {
qga/vss-win32/qga-vss.def +2 -0
index 927782c31b..ee97a81427 100644
@@ -1,6 +1,8 @@
 LIBRARY      "QGA-PROVIDER.DLL"
 
 EXPORTS
+	DLLCOMRegister
+	DLLCOMUnregister
 	COMRegister		PRIVATE
 	COMUnregister		PRIVATE
 	DllCanUnloadNow		PRIVATE
Signature · 1 line
2.25.1
Reviewed-by on v1 2/2
#8 lore raw

Re: [PATCH 2/2] qga/win32: Use rundll for VSS installation

Quoted 82 lines · Konstantin Kostiuk

Add specific an entry points for rundll which is just a wrapper for COMRegister/COMUnregister functions.

resolves: rhbz#2167436
fixes: CVE-2023-0664

---
 qga/installer/qemu-ga.wxs | 10 +++++-----
 qga/vss-win32/install.cpp |  9 +++++++++
 qga/vss-win32/qga-vss.def |  2 ++
 3 files changed, 16 insertions(+), 5 deletions(-)
qga/installer/qemu-ga.wxs +5 -5
index feb629ec47..46ae9e7a13 100644
@@ -127,22 +127,22 @@
       </Directory>
     </Directory>
 
-    <Property Id="cmd" Value="cmd.exe"/>
+    <Property Id="rundll" Value="rundll32.exe"/>
     <Property Id="REINSTALLMODE" Value="amus"/>
 
     <?ifdef var.InstallVss?>
     <CustomAction Id="RegisterCom"
-              ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-install'
+              ExeCommand='"[qemu_ga_directory]qga-vss.dll",DLLCOMRegister'
               Execute="deferred"
-              Property="cmd"
+              Property="rundll"
               Impersonate="no"
               Return="check"
               >
     </CustomAction>
     <CustomAction Id="UnRegisterCom"
-              ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-uninstall'
+              ExeCommand='"[qemu_ga_directory]qga-vss.dll",DLLCOMUnregister'
               Execute="deferred"
-              Property="cmd"
+              Property="rundll"
               Impersonate="no"
               Return="check"
               >
qga/vss-win32/install.cpp +9 -0
index b57508fbe0..68662a6dfc 100644
@@ -357,6 +357,15 @@ out:
     return hr;
 }
 
+STDAPI_(void) CALLBACK DLLCOMRegister(HWND, HINSTANCE, LPSTR, int)
+{
+    COMRegister();
+}
+
+STDAPI_(void) CALLBACK DLLCOMUnregister(HWND, HINSTANCE, LPSTR, int)
+{
+    COMUnregister();
+}
 
 static BOOL CreateRegistryKey(LPCTSTR key, LPCTSTR value, LPCTSTR data)
 {
qga/vss-win32/qga-vss.def +2 -1
index 927782c31b..ee97a81427 100644
@@ -1,6 +1,8 @@
 LIBRARY      "QGA-PROVIDER.DLL"
 
 EXPORTS
+       DLLCOMRegister
+       DLLCOMUnregister
        COMRegister             PRIVATE
        COMUnregister           PRIVATE
        DllCanUnloadNow         PRIVATE
--

2.25.1