All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Changlong Xie <xiecl.fnst@cn.fujitsu.com>,
	Wei Liu <Wei.Liu2@citrix.com>,
	Wen Congyang <wency@cn.fujitsu.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	xen devel <xen-devel@lists.xen.org>,
	Shriram Rajagopalan <rshriram@cs.ubc.ca>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Yang Hongyang <hongyang.yang@easystack.cn>
Subject: Re: [PATCH 5/5] Allow all user to create a file under the directory /var/lib/xen
Date: Wed, 27 Jan 2016 09:48:48 +0000	[thread overview]
Message-ID: <1453888128.25257.58.camel@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1601261605300.3619@kaball.uk.xensource.com>

On Tue, 2016-01-26 at 17:15 +0000, Stefano Stabellini wrote:
> It is sufficient to create an empty save file, as returned by
> libxl__device_model_savefile, with the right owner, at domain creation
> time. Something like below:
> 
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index a088d71..f908422 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -1285,6 +1285,12 @@ end_search:
>          if (user != NULL && strcmp(user, "root")) {
>              flexarray_append(dm_args, "-runas");
>              flexarray_append(dm_args, user);
> +
> +            const char *filename = libxl__device_model_savefile(gc, guest_domid);
> +            int fd = open(filename, O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0600);
> +            struct passwd *pw = getpwnam(user);
> +            fchown(fd, pw->pw_uid, pw->pw_gid);
> +            close(fd);
>          }
>      }
>      flexarray_append(dm_args, NULL);
> 
> This is another thing that would be easier to fix after Ian's privsep
> series, because we'll have a better place for this code.

Right.

In the meantime I think we should update at least docs/misc/qemu-
deprivilege.txt and probably docs/man/xl.cfg.pod.5:device_model_user to
mention the shortcomings of using these options if they are going to break
core functionality such as migration.

Would you knock up a patch please?

At the same time, I wonder if docs/misc/qemu-deprivilege.txt ought to move
to docs/features/ ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-01-27  9:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30  1:39 [PATCH 0/5] migration/remus: bug fix and cleanup Wen Congyang
2015-12-30  1:39 ` [PATCH 1/5] remus: don't call stream_continue() when doing failover Wen Congyang
2015-12-30 10:43   ` Andrew Cooper
2015-12-30  1:39 ` [PATCH 2/5] remus: don't write xenstore data if it fails Wen Congyang
2015-12-30 10:47   ` Andrew Cooper
2015-12-31  1:00     ` Wen Congyang
2015-12-30  1:39 ` [PATCH 3/5] tools/libxc: don't send end record if remus fails Wen Congyang
2015-12-30 11:11   ` Andrew Cooper
2015-12-31  0:49     ` Wen Congyang
2015-12-30  1:39 ` [PATCH 4/5] tools/libxl: remove unused function libxl__domain_save_device_model() Wen Congyang
2015-12-30  1:39 ` [PATCH 5/5] Allow all user to create a file under the directory /var/lib/xen Wen Congyang
2015-12-30  4:11   ` Doug Goldstein
2015-12-30  5:25     ` Wen Congyang
2015-12-30 11:00       ` Andrew Cooper
2016-01-25 20:36         ` Konrad Rzeszutek Wilk
2016-01-26  0:00           ` Andrew Cooper
2016-01-26  9:30             ` Ian Campbell
2016-01-26 17:15               ` Stefano Stabellini
2016-01-27  9:48                 ` Ian Campbell [this message]
2015-12-30 10:38 ` [PATCH 0/5] migration/remus: bug fix and cleanup Andrew Cooper
2015-12-31  0:48   ` Wen Congyang

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=1453888128.25257.58.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=Wei.Liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=hongyang.yang@easystack.cn \
    --cc=rshriram@cs.ubc.ca \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wency@cn.fujitsu.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xiecl.fnst@cn.fujitsu.com \
    /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.