All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>, Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: [PATCH v3 2/3] Revert "libxl: fix build on rather old systems"
Date: Mon, 14 Jan 2019 14:59:36 +0000	[thread overview]
Message-ID: <20190114145937.16682-2-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <23608.54527.696432.275991@mariner.uk.xensource.com>

This reverts commit 1bce5f9baf0f4a4e50722f32b44afe4fdefc6b35.

This situation should be handled by disabling the dm restrict
feature, not silently falling back to lower protection.

Also this #ifdeffery is bad style.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_linux.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/tools/libxl/libxl_linux.c b/tools/libxl/libxl_linux.c
index a4c2f28dbf..6475cca64b 100644
--- a/tools/libxl/libxl_linux.c
+++ b/tools/libxl/libxl_linux.c
@@ -334,24 +334,12 @@ int libxl__local_dm_preexec_restrict(libxl__gc *gc)
     unsigned i;
 
     /* Unshare mount and IPC namespaces.  These are unused by QEMU. */
-    r = unshare(CLONE_NEWNS);
+    r = unshare(CLONE_NEWNS | CLONE_NEWIPC);
     if (r) {
-        LOGE(ERROR, "libxl: Mount namespace unshare failed");
+        LOGE(ERROR, "libxl: Mount and IPC namespace unfailed");
         return ERROR_FAIL;
     }
 
-#ifndef CLONE_NEWIPC /* Available as of Linux 2.6.19 / glibc 2.8 */
-# define CLONE_NEWIPC 0x08000000
-#endif
-    r = unshare(CLONE_NEWIPC);
-    if (r) {
-        if (r && errno != EINVAL) {
-            LOGE(ERROR, "libxl: IPC namespace unshare failed");
-            return ERROR_FAIL;
-        }
-        LOG(WARN, "libxl: IPC namespace unshare unavailable");
-    }
-
     /* Set various "easy" rlimits */
     for (i = 0; rlimits[i].resource != RLIMIT_NLIMITS; i++) {
         struct rlimit rlim;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-01-14 14:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5C386B5F020000780020C96B@suse.com>
2019-01-11 14:42 ` [PATCH] libxl: fix build on rather old systems Juergen Gross
2019-01-11 17:40   ` Ian Jackson
2019-01-11 18:12     ` [PATCH 1/2] Revert "libxl: fix build on rather old systems" Ian Jackson
2019-01-11 18:12       ` [PATCH 2/2] libxl: fix build (missing CLONE_NEWIPC) on astonishingly old systems Ian Jackson
2019-01-11 18:27         ` Anthony PERARD
2019-01-11 19:21           ` Ian Jackson
2019-01-11 19:23           ` [PATCH v2 " Ian Jackson
     [not found]             ` <4C7EABEB02000006B8D7C7D4@prv1-mh.provo.novell.com>
     [not found]               ` <9E406FBD020000569DFFD529@prv1-mh.provo.novell.com>
     [not found]                 ` <9E4077BD020000969DFFD529@prv1-mh.provo.novell.com>
     [not found]                   ` <81E41643020000ABCFD95477@prv1-mh.provo.novell.com>
     [not found]                     ` <CE47AFED020000429DFFD529@prv1-mh.provo.novell.com>
2019-01-14  9:47                       ` Jan Beulich
2019-01-14 11:37                         ` Wei Liu
2019-01-14 14:22                           ` Ian Jackson
2019-01-14 14:27                             ` Jan Beulich
2019-01-14 14:59     ` [PATCH v3 1/3] docs/features/qemu-deprivilege.pandoc: No support with Linux <2.6.18 Ian Jackson
2019-01-14 15:02       ` Wei Liu
2019-01-16 10:41       ` Juergen Gross
2019-01-14 14:59     ` Ian Jackson [this message]
2019-01-14 15:02       ` [PATCH v3 2/3] Revert "libxl: fix build on rather old systems" Wei Liu
2019-01-14 14:59     ` [PATCH v3 3/3] libxl: fix build (missing CLONE_NEWIPC) on astonishingly old systems Ian Jackson
2019-01-14 15:04       ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190114145937.16682-2-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.