All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Ian Jackson <ian.jackson@citrix.com>
Cc: Anthony Perard <anthony.perard@citrix.com>,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v2 6/6] RFC: tools/dm_restrict: Enable QEMU sandboxing
Date: Mon, 24 Sep 2018 14:43:23 +0100	[thread overview]
Message-ID: <dedc9e35-984f-ef21-d508-e411ef2a4a66@citrix.com> (raw)
In-Reply-To: <23464.57587.641742.948316@mariner.uk.xensource.com>

On 09/24/2018 02:04 PM, Ian Jackson wrote:
> George Dunlap writes ("Re: [PATCH v2 6/6] RFC: tools/dm_restrict: Enable QEMU sandboxing"):
>> From qemu-depriv.md:
>>
>> `elevateprivileges` is currently required to allow `-runas` to work.
>> Removing this requirement would mean making sure that the uid change
>> happened before the seccomp2 call, perhaps by changing the uid before
>> executing QEMU.  (But this would then require other changes to create
>> the QMP socket, VNC socket, and so on).
>>
>> Should I C&P this into a comment here?
> 
> Yes.
> 
> I think the conclusion I would draw from that comment is not that the
> uid change should happen before exec'ing qemu, but that the seccomp
> call in qemu is made too early.  But fine.

Yeah, I was thinking that just after I sent this mail too; it would be
good to see if there was a reasoning behind that.

>>> In this syntax, what happens with unmentioned abilities ?
>>
>> Good question -- the -help doesn't seem to say.  Looking at the code
>> (qemu-seccomp.c:parse_sandbox()) for those who want to follow along at
>> home), it seems different options have different default values (which
>> are not mentioned) -- obsolete is default deny, but spawn,
>> elevateprivileges, and resourcsecontrol are default allow.
> 
> Erk.  I guess we could parse -help output :-/.
> 
> What about capabilities not known to the qemu source code ?

Hrm -- it looks like the sandboxing stuff is based on a blacklist,
rather than a whitelist.  Which may be inevitable, given that seccomp2
operates on system calls but qemu makes library calls (and thus doesn't
actually know which system calls are need and which are not -- see [1]).
 But it does rather undermine the usefulness of this as a security
feature -- there are literally hundreds of system calls available on
Linux, of which only 50 or so are listed here.

Luckily `-sandbox` was just one of the "sure why not" layers of extra
security, not something we rely on.

We could add a test to our testing script to parse `-help` output for
unknown-to-libxl options and throw an error, so that they get added in,
if we want.

 -George

[1] https://lwn.net/Articles/738694/

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

  reply	other threads:[~2018-09-24 13:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21 17:04 [PATCH v2 1/6] docs/qemu-deprivilege: Revise and update with status and future plans George Dunlap
2018-09-21 17:04 ` [PATCH v2 2/6] test/depriv: Add a tool to check process-level depriv George Dunlap
2018-09-24 10:57   ` Ian Jackson
2018-09-24 14:45     ` George Dunlap
2018-09-24 11:14   ` Anthony PERARD
2018-09-21 17:04 ` [PATCH v2 3/6] tools/dm_restrict: Ask QEMU to chroot George Dunlap
2018-09-24  8:20   ` Paul Durrant
2018-09-24  9:50     ` George Dunlap
2018-09-24  9:52       ` Paul Durrant
2018-09-24 10:31   ` Ian Jackson
2018-09-21 17:04 ` [PATCH v2 4/6] tools/dm_restrict: Unshare mount and IPC namespaces on Linux George Dunlap
2018-09-24  8:24   ` Paul Durrant
2018-09-24 10:40   ` Ian Jackson
2018-09-24 14:22     ` George Dunlap
2018-09-25 10:55       ` Ian Jackson
2018-09-21 17:04 ` [PATCH v2 5/6] tools/dm_depriv: Add first cut RLIMITs George Dunlap
2018-09-24  8:34   ` Paul Durrant
     [not found]     ` <CAFLBxZanne777R0WfJLuGqTv3dx=A+W0Z5UsW9B0i4MFMWWKXw@mail.gmail.com>
2018-10-05 15:18       ` George Dunlap
2018-09-24 10:48   ` Ian Jackson
2018-09-24 14:41     ` George Dunlap
2018-09-25 11:03       ` Ian Jackson
2018-09-21 17:04 ` [PATCH v2 6/6] RFC: tools/dm_restrict: Enable QEMU sandboxing George Dunlap
2018-09-24 10:49   ` Ian Jackson
2018-09-24 11:16     ` George Dunlap
2018-09-24 13:04       ` Ian Jackson
2018-09-24 13:43         ` George Dunlap [this message]
2018-09-25 10:46           ` Ian Jackson
2018-09-24 11:21   ` Ian Jackson
2018-09-24 14:28     ` George Dunlap
2018-09-25 11:02       ` Ian Jackson
2018-09-25 14:24         ` George Dunlap
2018-09-26 10:57           ` Ian Jackson
2018-09-24  8:14 ` [PATCH v2 1/6] docs/qemu-deprivilege: Revise and update with status and future plans Paul Durrant
2018-09-24 10:23 ` Ian Jackson
2018-09-24 13:08   ` George Dunlap
2018-09-25 10:44     ` Ian Jackson
2018-09-25 11:20 ` Anthony PERARD
2018-09-28 11:37   ` George Dunlap
2018-09-28 12:59     ` Anthony PERARD

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=dedc9e35-984f-ef21-d508-e411ef2a4a66@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=sstabellini@kernel.org \
    --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.