From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v8] run QEMU as non-root Date: Fri, 2 Oct 2015 13:17:11 +0100 Message-ID: <1443788231.11707.84.camel@citrix.com> References: <1443627946-4716-1-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1443627946-4716-1-git-send-email-stefano.stabellini@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini , xen-devel@lists.xensource.com Cc: Ian.Jackson@eu.citrix.com, wei.liu2@citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, 2015-09-30 at 16:45 +0100, Stefano Stabellini wrote: > QEMU is going to setuid and setgid to the user ID and the group ID of > the specified user, soon after initialization, before starting to deal > with any guest IO. Can you confirm that QEMU will bail if the user given via -runas doesn't exist. IOW if the user gives b_info->device_model_user != NULL we will correctly end up bailing if that specific user doesn't exist rather than running as root? If that is the case then: Acked-by: Ian Campbell Wasn't there some code to plumb this into xl at one point? Did that get dropped along the way? > [...] > + user = NULL; > + LOG(WARN, "Could not find user %s, starting QEMU as root", > + LIBXL_QEMU_USER_SHARED); > + > +end_search: > + if (user != NULL && strcmp(user, "root")) { This strcmp struck me as odd given the user = NULL just above, but this is for the case where the user explicitly requested root, right? > + flexarray_append(dm_args, "-runas"); > + flexarray_append(dm_args, user); > + }