Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-30 Thread George Dunlap
> On Nov 28, 2018, at 4:56 PM, Ian Jackson wrote: > >> if (!xs_rm(CTX->xsh, XBT_NULL, path)) >> LOGD(ERROR, domid, "xs_rm failed for %s", path); >> >> -/* We should try to destroy the device model anyway. */ >> -rc = kill_device_model(gc, >> -

Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-29 Thread Ian Jackson
George Dunlap writes ("Re: [PATCH 8/9] libxl: Kill QEMU by uid when possible"): > > On Nov 29, 2018, at 12:26 PM, Ian Jackson wrote: > > George Dunlap writes ("Re: [PATCH 8/9] libxl: Kill QEMU by uid when > > possible"): > >> It wouldn’t be terribly hard to have a common “exit” to both the > >>

Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-29 Thread Ian Jackson
George Dunlap writes ("Re: [PATCH 8/9] libxl: Kill QEMU by uid when possible"): > Right, I didn’t notice that read_checked filtered out ENOENT (thus a non-zero > value for ret indicates a different error). > > Not really sure what the best thing would be to do in that case; maybe > returning an

Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-29 Thread George Dunlap
> On Nov 29, 2018, at 12:26 PM, Ian Jackson wrote: > > George Dunlap writes ("Re: [PATCH 8/9] libxl: Kill QEMU by uid when > possible"): >> It wouldn’t be terribly hard to have a common “exit” to both the >> kill-by-pid and kill-by-uid paths that did it once, but it would >> involve adding

Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-29 Thread Ian Jackson
George Dunlap writes ("Re: [PATCH 8/9] libxl: Kill QEMU by uid when possible"): > It wouldn’t be terribly hard to have a common “exit” to both the > kill-by-pid and kill-by-uid paths that did it once, but it would > involve adding Yet Another Function; and each additional function > makes the code

Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-29 Thread George Dunlap
> On Nov 29, 2018, at 11:55 AM, Wei Liu wrote: > > On Wed, Nov 28, 2018 at 03:57:58PM +, Anthony PERARD wrote: >> On Fri, Nov 23, 2018 at 05:18:59PM +, George Dunlap wrote: >>> On 11/23/18 5:15 PM, George Dunlap wrote: >>> Does libxl__qmp_cleanup() need to be called after the kill()

Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-29 Thread Wei Liu
On Wed, Nov 28, 2018 at 03:57:58PM +, Anthony PERARD wrote: > On Fri, Nov 23, 2018 at 05:18:59PM +, George Dunlap wrote: > > On 11/23/18 5:15 PM, George Dunlap wrote: > > Does libxl__qmp_cleanup() need to be called after the kill() happens? > > If not, we could put this before the kill()

Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-28 Thread George Dunlap
> On Nov 28, 2018, at 4:56 PM, Ian Jackson wrote: > > George Dunlap writes ("[PATCH 8/9] libxl: Kill QEMU by uid when possible"): >> The privcmd fd that a dm_restrict'ed QEMU has gives it permission to >> one specific domain ID. This domain ID will probably eventually be >> used again. It is

Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-28 Thread Ian Jackson
George Dunlap writes ("[PATCH 8/9] libxl: Kill QEMU by uid when possible"): > The privcmd fd that a dm_restrict'ed QEMU has gives it permission to > one specific domain ID. This domain ID will probably eventually be > used again. It is therefore necessary to make absolutely sure that a > rogue

Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-28 Thread Anthony PERARD
On Fri, Nov 23, 2018 at 05:18:59PM +, George Dunlap wrote: > On 11/23/18 5:15 PM, George Dunlap wrote: > Does libxl__qmp_cleanup() need to be called after the kill() happens? > If not, we could put this before the kill() and avoid having two call sites. QEMU is supposed to create monitor

Re: [Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-23 Thread George Dunlap
On 11/23/18 5:15 PM, George Dunlap wrote: > The privcmd fd that a dm_restrict'ed QEMU has gives it permission to > one specific domain ID. This domain ID will probably eventually be > used again. It is therefore necessary to make absolutely sure that a > rogue QEMU process cannot hang around

[Xen-devel] [PATCH 8/9] libxl: Kill QEMU by uid when possible

2018-11-23 Thread George Dunlap
The privcmd fd that a dm_restrict'ed QEMU has gives it permission to one specific domain ID. This domain ID will probably eventually be used again. It is therefore necessary to make absolutely sure that a rogue QEMU process cannot hang around after its domain has exited. Killing QEMU by pid is