Blame SOURCES/ovt-Properly-check-authorization-on-incoming-guestOps-re.patch

c3c1a4
From c8e1e5c668ead319b7a91a3a3d7decb114c5daef Mon Sep 17 00:00:00 2001
c3c1a4
From: Cathy Avery <cavery@redhat.com>
c3c1a4
Date: Mon, 29 Aug 2022 12:50:45 -0400
c3c1a4
Subject: [PATCH] Properly check authorization on incoming guestOps requests.
c3c1a4
c3c1a4
RH-Author: Cathy Avery <cavery@redhat.com>
c3c1a4
RH-MergeRequest: 12: Properly check authorization on incoming guestOps requests.
c3c1a4
RH-Bugzilla: 2119284
c3c1a4
RH-Acked-by: Mohamed Gamal Morsy <mmorsy@redhat.com>
c3c1a4
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
c3c1a4
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
c3c1a4
RH-Commit: [1/1] d2f10cdcba9d606492f371790c3a0be5b8ce965c
c3c1a4
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2119284
c3c1a4
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=47492094
c3c1a4
Tested: Tested by QE
c3c1a4
Upstream Status: origin/master
c3c1a4
Conflicts: None
c3c1a4
c3c1a4
    commit 70a74758bfe0042c27f15ce590fb21a2bc54d745
c3c1a4
    Author: John Wolfe <jwolfe@vmware.com>
c3c1a4
    Date:   Sun Aug 21 07:56:49 2022 -0700
c3c1a4
c3c1a4
    Properly check authorization on incoming guestOps requests.
c3c1a4
c3c1a4
    Fix public pipe request checks.  Only a SessionRequest type should
c3c1a4
    be accepted on the public pipe.
c3c1a4
c3c1a4
Signed-off-by: Cathy Avery <cavery@redhat.com>
c3c1a4
---
c3c1a4
 open-vm-tools/vgauth/serviceImpl/proto.c | 6 +++++-
c3c1a4
 1 file changed, 5 insertions(+), 1 deletion(-)
c3c1a4
c3c1a4
diff --git a/open-vm-tools/vgauth/serviceImpl/proto.c b/open-vm-tools/vgauth/serviceImpl/proto.c
c3c1a4
index db7159ee..6c672601 100644
c3c1a4
--- a/open-vm-tools/vgauth/serviceImpl/proto.c
c3c1a4
+++ b/open-vm-tools/vgauth/serviceImpl/proto.c
c3c1a4
@@ -1,5 +1,5 @@
c3c1a4
 /*********************************************************
c3c1a4
- * Copyright (C) 2011-2016,2019-2021 VMware, Inc. All rights reserved.
c3c1a4
+ * Copyright (C) 2011-2016,2019-2022 VMware, Inc. All rights reserved.
c3c1a4
  *
c3c1a4
  * This program is free software; you can redistribute it and/or modify it
c3c1a4
  * under the terms of the GNU Lesser General Public License as published
c3c1a4
@@ -1201,6 +1201,10 @@ Proto_SecurityCheckRequest(ServiceConnection *conn,
c3c1a4
    VGAuthError err;
c3c1a4
    gboolean isSecure = ServiceNetworkIsConnectionPrivateSuperUser(conn);
c3c1a4
 
c3c1a4
+   if (conn->isPublic && req->reqType != PROTO_REQUEST_SESSION_REQ) {
c3c1a4
+      return VGAUTH_E_PERMISSION_DENIED;
c3c1a4
+   }
c3c1a4
+
c3c1a4
    switch (req->reqType) {
c3c1a4
       /*
c3c1a4
        * This comes over the public connection; alwsys let it through.
c3c1a4
-- 
c3c1a4
2.35.3
c3c1a4