Blob Blame History Raw
From bb4d2abe30f8ad3de4f7f3201de897440cdd545c Mon Sep 17 00:00:00 2001
Message-Id: <bb4d2abe30f8ad3de4f7f3201de897440cdd545c@dist-git>
From: Julio Faracco <jcfaracco@gmail.com>
Date: Mon, 1 Jul 2019 17:05:46 +0200
Subject: [PATCH] util: moving 'type' argument to avoid issues with mount()
 syscall.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This commit fixes a mount call inside virgroup.c file. The NULL value
into 'type' argument is causing a valgrind issue. See commit 794b576c
for more details. The best approach to fix it is moving NULL to "none"
filesytem.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
(cherry picked from commit 4539301bc84ee65558a48c1c3c22aa04f458dbe0)

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Message-Id: <006a95f4385f575718eee431fc905702cff3e848.1561993099.git.phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/util/vircgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 0a31947b0d..e810a3d81d 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -3962,7 +3962,7 @@ virCgroupBindMount(virCgroupPtr group, const char *oldroot,
                 goto cleanup;
             }
 
-            if (mount(src, group->controllers[i].mountPoint, NULL, MS_BIND,
+            if (mount(src, group->controllers[i].mountPoint, "none", MS_BIND,
                       NULL) < 0) {
                 virReportSystemError(errno,
                                      _("Failed to bind cgroup '%s' on '%s'"),
-- 
2.22.0