From nobody Sun Feb 8 13:44:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152998314333047.81470564599658; Mon, 25 Jun 2018 20:19:03 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA0653082155; Tue, 26 Jun 2018 03:19:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 698C777E99; Tue, 26 Jun 2018 03:18:59 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0A4C24A460; Tue, 26 Jun 2018 03:18:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5Q3IqAi017244 for ; Mon, 25 Jun 2018 23:18:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id A5FAC7D956; Tue, 26 Jun 2018 03:18:52 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9EBFC7D959 for ; Tue, 26 Jun 2018 03:18:46 +0000 (UTC) Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 803C35F732 for ; Tue, 26 Jun 2018 03:18:35 +0000 (UTC) Received: by mail-qk0-f196.google.com with SMTP id y4-v6so8767736qka.5 for ; Mon, 25 Jun 2018 20:18:35 -0700 (PDT) Received: from localhost.localdomain ([186.223.98.86]) by smtp.gmail.com with ESMTPSA id d14-v6sm318604qtn.90.2018.06.25.20.18.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 20:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=V7OYC5M4NYgRxGfnOM9NSCisO5XJoHdwOZRD/E6oGq0=; b=icdrHXId+ncaUC8O9Vz3cw15ReJogCrm/6E11KdP+cRv7g+oz1/aOzYBrn6gsP3kVG p4aH4UNzepEaNuH1AVgeJ3jBq4eeumwTys+3uFTkicR5xdaqG3T06L/QmdpiPzhTI6Dw 8xcckQFNbuv5ghkFG4JHYmTxsSiZKJU8tUmRABrFGYpZmGZ85RT47e00rTk9v0x7/3DO RFct0GvvNLC8+SmNdVatTZuEv917Pkevyl4BPbl3k+GUbihlcwBGj+GO5FA3n8hFATf/ 88DO76O2cKmYub71qmh+ehVCIYGGp3gfhGVbzMOhtVjMAmFe4W35D7piaLsbPm/FqEDK Fraw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=V7OYC5M4NYgRxGfnOM9NSCisO5XJoHdwOZRD/E6oGq0=; b=bb/g3QTraMrnTaxuW0SQ+cFP2uqodCPQ0XfkF3Fneu0b77Y2yDIpfhygjxHwQAfy4x hhs9nsqp0fdQBdMHwSq26vEvApKKfY1QxGbRKyGwjXXsoOztsqjnzU/PadxKX8ARF+/f ulCfKsQyoJtrFhS1VC6dI8u1u1ydskNCoP9iQ8ocfgu5ZuUhkQ73GNox7v/58iadIvnA ay8Q0yzu2KwqlannnJl/pbDMtNBK7x5sxu/N6ciZW16RWdwU6d7hhGW0VMu5bFppK4LH uFFiPWZeTxVtw27cQjl8bfS+37h+O5xDiB2hw1RjXRfuS2mGFZZsBhbAppW9B0YySYnc doTw== X-Gm-Message-State: APt69E2cPoTkSGynC+DWS474FsvFuypnAGYaFw285gNQTUc2L9HYqmD3 XzAbirkcKUldz/yP7eaAo3f9GQ== X-Google-Smtp-Source: ADUXVKK3Xy4KfxuE7Vu8A0CsvhMFJtCatQS0Yr3cAKghaI22eyFY/FmfIhWMTW2PIoDxzV0SlSh+Sw== X-Received: by 2002:a37:4792:: with SMTP id u140-v6mr13030259qka.100.1529983114455; Mon, 25 Jun 2018 20:18:34 -0700 (PDT) From: Julio Faracco To: libvir-list@redhat.com Date: Tue, 26 Jun 2018 00:18:21 -0300 Message-Id: <20180626031821.29541-1-jcfaracco@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 26 Jun 2018 03:18:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 26 Jun 2018 03:18:35 +0000 (UTC) for IP:'209.85.220.196' DOMAIN:'mail-qk0-f196.google.com' HELO:'mail-qk0-f196.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.281 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS, T_DKIM_INVALID) 209.85.220.196 mail-qk0-f196.google.com 209.85.220.196 mail-qk0-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] util: fix mount issue by moving NULL value to "none" in syscall. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 26 Jun 2018 03:19:02 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" After running libvirt daemon with valgrind tools, some errors are appearing when you try to start a domain. One example: =3D=3D18012=3D=3D Syscall param mount(type) points to unaddressable byte(s) =3D=3D18012=3D=3D at 0x6FEE3CA: mount (syscall-template.S:78) =3D=3D18012=3D=3D by 0x531344D: virFileMoveMount (virfile.c:3828) =3D=3D18012=3D=3D by 0x27FE7675: qemuDomainBuildNamespace (qemu_domain.c= :11501) =3D=3D18012=3D=3D by 0x2800C44E: qemuProcessHook (qemu_process.c:2870) =3D=3D18012=3D=3D by 0x52F7E1D: virExec (vircommand.c:726) =3D=3D18012=3D=3D by 0x52F7E1D: virCommandRunAsync (vircommand.c:2477) =3D=3D18012=3D=3D by 0x52F4EDD: virCommandRun (vircommand.c:2309) =3D=3D18012=3D=3D by 0x2800A731: qemuProcessLaunch (qemu_process.c:6235) =3D=3D18012=3D=3D by 0x2800D6B4: qemuProcessStart (qemu_process.c:6569) =3D=3D18012=3D=3D by 0x28074876: qemuDomainObjStart (qemu_driver.c:7314) =3D=3D18012=3D=3D by 0x280522EB: qemuDomainCreateWithFlags (qemu_driver.= c:7367) =3D=3D18012=3D=3D by 0x55484BF: virDomainCreate (libvirt-domain.c:6531) =3D=3D18012=3D=3D by 0x12CDBD: remoteDispatchDomainCreate (remote_daemon= _dispatch_stubs.h:4350) =3D=3D18012=3D=3D by 0x12CDBD: remoteDispatchDomainCreateHelper (remote_= daemon_dispatch_stubs.h:4326) =3D=3D18012=3D=3D Address 0x0 is not stack'd, malloc'd or (recently) free'd Some documentation recommends to use "none" when you don't have a filesystem type to use. Specially, for bind and move actions. Signed-off-by: Julio Faracco --- src/util/virfile.c | 2 +- src/util/virprocess.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 9296ccbe2a..378d03ecf0 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3825,7 +3825,7 @@ virFileMoveMount(const char *src, { const unsigned long mount_flags =3D MS_MOVE; =20 - if (mount(src, dst, NULL, mount_flags, NULL) < 0) { + if (mount(src, dst, "none", mount_flags, NULL) < 0) { virReportSystemError(errno, _("Unable to move %s mount to %s"), src, dst); diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 1fbbbb3a27..f92b0dce37 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -1181,7 +1181,7 @@ virProcessSetupPrivateMountNS(void) goto cleanup; } =20 - if (mount("", "/", NULL, MS_SLAVE|MS_REC, NULL) < 0) { + if (mount("", "/", "none", MS_SLAVE|MS_REC, NULL) < 0) { virReportSystemError(errno, "%s", _("Failed to switch root mount into slave mod= e")); goto cleanup; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list