[Qemu-devel] [PATCH v4 3/4] Add cap reduction support to enable use as SUID

2011-11-01 Thread Corey Bryant
prove security, use libcap to reduce our capability set to just cap_net_admin, then reduce privileges down to the calling user. This is hopefully close to equivalent to fscap support from a security perspective. Signed-off-by: Anthony Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey B

[Qemu-devel] [PATCH v4 2/4] Add access control support to qemu bridge helper

2011-11-01 Thread Corey Bryant
ny Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey Bryant --- qemu-bridge-helper.c | 153 ++ 1 files changed, 153 insertions(+), 0 deletions(-) diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c index 1b78781..b5898a5 100644 --- a/q

[Qemu-devel] [PATCH v4 4/4] Add support for net bridge

2011-11-01 Thread Corey Bryant
io or: qemu linux.img -net tap,helper=/usr/local/libexec/qemu-bridge-helper,br=qemubr0 -net nic,model=virtio Signed-off-by: Anthony Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey Bryant --- configure |2 + net.c | 29 - net.h

[Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper

2011-11-01 Thread Corey Bryant
. The helper can then exit and let qemu use the tap device. Signed-off-by: Anthony Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey Bryant --- Makefile | 12 +++- configure|1 + qemu-bridge-helper.c | 218

[Qemu-devel] [PATCH v4 0/4] -net bridge: rootless bridge support for qemu

2011-11-01 Thread Corey Bryant
leted static analysis and memory analysis on helper v4: - Update has_vnet_hdr() to return bool - Update helper's main() to prevent errno clobbering - Let Kernel cleanup helper's file descriptors Corey Bryant (4): Add basic version of bridge helper Add access control support to qem

Re: [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper

2011-11-02 Thread Corey Bryant
On 11/02/2011 06:58 AM, Stefan Hajnoczi wrote: On Tue, Nov 1, 2011 at 5:13 PM, Corey Bryant wrote: +static bool has_vnet_hdr(int fd) +{ +unsigned int features = 0; +struct ifreq ifreq; + +if (ioctl(fd, TUNGETFEATURES,&features) == -1) { +return false; +} + +

Re: [Qemu-devel] [PATCH v4 4/4] Add support for net bridge

2011-11-02 Thread Corey Bryant
On 11/02/2011 04:12 AM, Mark Wu wrote: On 11/02/2011 01:13 AM, Corey Bryant wrote: static int net_tap_init(QemuOpts *opts, int *vnet_hdr) { int fd, vnet_hdr_required; @@ -433,8 +570,11 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan if (qemu_opt_get(opts

Re: [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper

2011-11-03 Thread Corey Bryant
On 11/03/2011 03:54 AM, Stefan Hajnoczi wrote: On Wed, Nov 2, 2011 at 3:12 PM, Corey Bryant wrote: On 11/02/2011 06:58 AM, Stefan Hajnoczi wrote: On Tue, Nov 1, 2011 at 5:13 PM, Corey Bryant wrote: +static bool has_vnet_hdr(int fd) +{ +unsigned int features = 0; +struct ifreq

Re: [Qemu-devel] [PATCH v3 4/4] Add support for net bridge

2011-11-03 Thread Corey Bryant
On 11/02/2011 11:10 PM, Mark Wu wrote: On 11/01/2011 02:36 AM, Corey Bryant wrote: The default bridge that we attach to is br0. The thinking is that a distro could preconfigure such an interface to allow out-of-the-box bridged networking. Alternatively, if a user wants to use a different

Re: [Qemu-devel] [PATCH v4 0/4] -net bridge: rootless bridge support for qemu

2011-11-08 Thread Corey Bryant
ation/attaching of a tap device should be handled by the helper. Regards, Corey On Wed, Nov 2, 2011 at 1:13 AM, Corey Bryant wrote: With qemu it is possible to run a guest from an unprivileged user but if we wanted to communicate with the outside world we had to switch to root. We address this pr

[Qemu-devel] [PATCH v5 2/4] Add access control support to qemu bridge helper

2011-11-13 Thread Corey Bryant
ny Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey Bryant --- qemu-bridge-helper.c | 153 ++ 1 files changed, 153 insertions(+), 0 deletions(-) diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c index e0ba917..2f137c2 100644 --- a/q

[Qemu-devel] [PATCH v5 0/4] -net bridge: rootless bridge support for qemu

2011-11-13 Thread Corey Bryant
documentation - Disallow vnet_hdr option with -net tap,helper Corey Bryant (4): Add basic version of bridge helper Add access control support to qemu bridge helper Add cap reduction support to enable use as SUID Add support for net bridge Makefile | 12 ++- confi

[Qemu-devel] [PATCH v5 3/4] Add cap reduction support to enable use as SUID

2011-11-13 Thread Corey Bryant
prove security, use libcap to reduce our capability set to just cap_net_admin, then reduce privileges down to the calling user. This is hopefully close to equivalent to fscap support from a security perspective. Signed-off-by: Anthony Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey B

[Qemu-devel] [PATCH v5 1/4] Add basic version of bridge helper

2011-11-13 Thread Corey Bryant
. The helper can then exit and let qemu use the tap device. Signed-off-by: Anthony Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey Bryant --- Makefile | 12 +++- configure|1 + qemu-bridge-helper.c | 213

[Qemu-devel] [PATCH v5 4/4] Add support for net bridge

2011-11-13 Thread Corey Bryant
xec/qemu-bridge-helper,br=qemubr0,id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1 Signed-off-by: Anthony Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey Bryant --- configure |2 + net.c | 29 - net.h |3 + net/tap

Re: [Qemu-devel] [PATCH v3] Add support for fd: protocol

2011-08-11 Thread Corey Bryant
On 07/26/2011 08:51 AM, Corey Bryant wrote: > +static int raw_open_fd(BlockDriverState *bs, const char *filename, int flags) > +{ > +BDRVRawState *s = bs->opaque; > +const char *fd_str; > +int fd; > + > +/* extract the file descriptor - fail if i

[Qemu-devel] [PATCH v4] Add support for fd: protocol

2011-08-22 Thread Corey Bryant
ned-off-by: Corey Bryant --- block.c |9 ++--- block/raw-posix.c | 99 migration-fd.c|2 +- monitor.c | 39 monitor.h |3 +- net.c |2 +- qemu-options.h

Re: [Qemu-devel] [PATCH v4] Add support for fd: protocol

2011-08-22 Thread Corey Bryant
On 08/22/2011 11:38 AM, Christoph Hellwig wrote: I'm still totally against this. FD passing is a nice feature for sandboxing, but the passing should be between closely cooperating programs. We'll need a tool shipped from the qemu source tree to open and set up the FDs, and not someone external.

Re: [Qemu-devel] [libvirt] [PATCH v4] Add support for fd: protocol

2011-08-22 Thread Corey Bryant
On 08/22/2011 01:25 PM, Anthony Liguori wrote: On 08/22/2011 11:50 AM, Daniel P. Berrange wrote: On Mon, Aug 22, 2011 at 11:29:12AM -0500, Anthony Liguori wrote: I don't think it makes sense to have qemu-fe do dynamic labelling. You certainly could avoid the fd passing by having qemu-fe do th

Re: [Qemu-devel] [libvirt] [PATCH v4] Add support for fd: protocol

2011-08-23 Thread Corey Bryant
On 08/22/2011 03:25 PM, Anthony Liguori wrote: On 08/22/2011 01:22 PM, Daniel P. Berrange wrote: On Mon, Aug 22, 2011 at 12:25:25PM -0500, Anthony Liguori wrote: On 08/22/2011 11:50 AM, Daniel P. Berrange wrote: On Mon, Aug 22, 2011 at 11:29:12AM -0500, Anthony Liguori wrote: I don't think it

Re: [Qemu-devel] [libvirt] [PATCH v4] Add support for fd: protocol

2011-08-23 Thread Corey Bryant
On 08/22/2011 02:39 PM, Blue Swirl wrote: On Mon, Aug 22, 2011 at 5:42 PM, Corey Bryant wrote: > > > On 08/22/2011 01:25 PM, Anthony Liguori wrote: >> >> On 08/22/2011 11:50 AM, Daniel P. Berrange wrote: >>> >>> On Mon, Aug 22, 2011 at

Re: [Qemu-devel] [libvirt] [PATCH v4] Add support for fd: protocol

2011-08-23 Thread Corey Bryant
On 08/23/2011 11:50 AM, Kevin Wolf wrote: Am 23.08.2011 17:26, schrieb Daniel P. Berrange: > On Tue, Aug 23, 2011 at 11:13:34AM -0400, Corey Bryant wrote: >> >> >> On 08/22/2011 02:39 PM, Blue Swirl wrote: >>> On Mon, Aug 22, 2011 at 5:42 PM, Corey Bryant w

[Qemu-devel] [PATCH v2] Add support for fd: protocol

2011-06-14 Thread Corey Bryant
ing the fd: protocol from the command line and the monitor. Tests were also run to verify existing file name support and qemu-img were not regressed. Non-valid file descriptors, fd: without format, snapshot and backing files were also tested. Signed-off-by: Corey Bryant --- block.c

Re: [Qemu-devel] [libvirt] [PATCH v2] Add support for fd: protocol

2011-06-14 Thread Corey Bryant
On 06/14/2011 12:13 PM, Eric Blake wrote: On 06/14/2011 07:31 AM, Corey Bryant wrote: > - Starting Qemu with a backing file What do you mean by this? Taking a guess: In the case of a qcow2 image with a backing file, does that mean that both the qcow2 image and it's backing

Re: [Qemu-devel] [libvirt] [PATCH v2] Add support for fd: protocol

2011-06-14 Thread Corey Bryant
On 06/14/2011 04:18 PM, Eric Blake wrote: On 06/14/2011 01:55 PM, Corey Bryant wrote: >> So we would need something like -drive >> file=fd:4,format=qcow2,backing=fd:5 >> >> and since backing files can be nested, we'd need some way of specifying >>

Re: [Qemu-devel] [PATCH v2] Add support for fd: protocol

2011-06-16 Thread Corey Bryant
On 06/15/2011 03:12 PM, Blue Swirl wrote: On Tue, Jun 14, 2011 at 4:31 PM, Corey Bryant wrote: > sVirt provides SELinux MAC isolation for Qemu guest processes and their > corresponding resources (image files). sVirt provides this support > by labeling guests and resources with

Re: [Qemu-devel] [PATCH v2] Add support for fd: protocol

2011-06-20 Thread Corey Bryant
On 06/18/2011 04:50 PM, Blue Swirl wrote: On Thu, Jun 16, 2011 at 5:48 PM, Corey Bryant wrote: On 06/15/2011 03:12 PM, Blue Swirl wrote: On Tue, Jun 14, 2011 at 4:31 PM, Corey Bryantwrote: sVirt provides SELinux MAC isolation for Qemu guest processes and their corresponding

[Qemu-devel] [PATCH] Add support for fd: protocol

2011-05-20 Thread Corey Bryant
valid file descriptors were also tested. Signed-off-by: Corey Bryant --- block/raw-posix.c | 70 ++--- qemu-doc.texi | 12 + qemu-options.hx |8 -- 3 files changed, 78 insertions(+), 12 deletions(-) diff --git a/block/raw-posix.c b

Re: [Qemu-devel] [PATCH] Add support for fd: protocol

2011-05-23 Thread Corey Bryant
On 05/23/2011 11:24 AM, Markus Armbruster wrote: Kevin Wolf writes: Am 20.05.2011 21:53, schrieb Blue Swirl: On Fri, May 20, 2011 at 10:42 PM, Anthony Liguori wrote: On 05/20/2011 02:25 PM, Blue Swirl wrote: On Fri, May 20, 2011 at 9:48 PM, Corey Bryant wrote: sVirt provides

Re: [Qemu-devel] [PATCH 3/4] Add cap reduction support to enable use as SUID

2011-10-06 Thread Corey Bryant
On 10/06/2011 01:42 PM, Anthony Liguori wrote: On 10/06/2011 11:34 AM, Daniel P. Berrange wrote: On Thu, Oct 06, 2011 at 11:38:27AM -0400, Richa Marwaha wrote: The ideal way to use qemu-bridge-helper is to give it an fscap of using: setcap cap_net_admin=ep qemu-bridge-helper Unfortunately,

Re: [Qemu-devel] [PATCH 3/4] Add cap reduction support to enable use as SUID

2011-10-06 Thread Corey Bryant
On 10/06/2011 01:42 PM, Anthony Liguori wrote: On 10/06/2011 11:34 AM, Daniel P. Berrange wrote: On Thu, Oct 06, 2011 at 11:38:27AM -0400, Richa Marwaha wrote: The ideal way to use qemu-bridge-helper is to give it an fscap of using: setcap cap_net_admin=ep qemu-bridge-helper Unfortunately,

Re: [Qemu-devel] [PATCH 1/4] Add basic version of bridge helper

2011-10-06 Thread Corey Bryant
On 10/06/2011 01:44 PM, Anthony Liguori wrote: On 10/06/2011 10:38 AM, Richa Marwaha wrote: This patch adds a helper that can be used to create a tap device attached to a bridge device. Since this helper is minimal in what it does, it can be given CAP_NET_ADMIN which allows qemu to avoid runni

Re: [Qemu-devel] [PATCH 4/4] Add support for bridge

2011-10-06 Thread Corey Bryant
On 10/06/2011 01:49 PM, Anthony Liguori wrote: On 10/06/2011 10:38 AM, Richa Marwaha wrote: The most common use of -net tap is to connect a tap device to a bridge. This requires the use of a script and running qemu as root in order to allocate a tap device to pass to the script. This model is

Re: [Qemu-devel] [PATCH 4/4] Add support for bridge

2011-10-06 Thread Corey Bryant
On 10/06/2011 02:19 PM, Anthony Liguori wrote: On 10/06/2011 01:15 PM, Corey Bryant wrote: On 10/06/2011 01:49 PM, Anthony Liguori wrote: On 10/06/2011 10:38 AM, Richa Marwaha wrote: The most common use of -net tap is to connect a tap device to a bridge. This requires the use of a script

Re: [Qemu-devel] [PATCH 1/4] Add basic version of bridge helper

2011-10-06 Thread Corey Bryant
On 10/06/2011 02:04 PM, Anthony Liguori wrote: On 10/06/2011 11:41 AM, Daniel P. Berrange wrote: On Thu, Oct 06, 2011 at 11:38:25AM -0400, Richa Marwaha wrote: This patch adds a helper that can be used to create a tap device attached to a bridge device. Since this helper is minimal in what it

Re: [Qemu-devel] [PATCH 1/4] Add basic version of bridge helper

2011-10-07 Thread Corey Bryant
On 10/07/2011 05:04 AM, Daniel P. Berrange wrote: On Thu, Oct 06, 2011 at 02:38:56PM -0400, Corey Bryant wrote: On 10/06/2011 02:04 PM, Anthony Liguori wrote: On 10/06/2011 11:41 AM, Daniel P. Berrange wrote: On Thu, Oct 06, 2011 at 11:38:25AM -0400, Richa Marwaha wrote: This patch adds

Re: [Qemu-devel] [PATCH 1/4] Add basic version of bridge helper

2011-10-07 Thread Corey Bryant
On 10/07/2011 10:45 AM, Daniel P. Berrange wrote: On Fri, Oct 07, 2011 at 10:40:56AM -0400, Corey Bryant wrote: On 10/07/2011 05:04 AM, Daniel P. Berrange wrote: On Thu, Oct 06, 2011 at 02:38:56PM -0400, Corey Bryant wrote: On 10/06/2011 02:04 PM, Anthony Liguori wrote: On 10/06/2011

Re: [Qemu-devel] [PATCH 1/4] Add basic version of bridge helper

2011-10-07 Thread Corey Bryant
On 10/07/2011 10:45 AM, Daniel P. Berrange wrote: On Fri, Oct 07, 2011 at 10:40:56AM -0400, Corey Bryant wrote: On 10/07/2011 05:04 AM, Daniel P. Berrange wrote: On Thu, Oct 06, 2011 at 02:38:56PM -0400, Corey Bryant wrote: On 10/06/2011 02:04 PM, Anthony Liguori wrote: On 10/06/2011

Re: [Qemu-devel] [PATCH] Move TPM passthrough specific command line options to backend structure

2013-04-10 Thread Corey Bryant
.name = "type", \ +.type = QEMU_OPT_STRING, \ +.help = "Type of TPM backend", \ +} + struct tpm_req_hdr { uint16_t tag; uint32_t len; -- Regards, Corey Bryant

Re: [Qemu-devel] [PATCH v2] tpm: Move TPM passthrough specific command line options to backend structure

2013-04-16 Thread Corey Bryant
ne TPM_STANDARD_CMDLINE_OPTS \ +{ \ +.name = "type", \ +.type = QEMU_OPT_STRING, \ +.help = "Type of TPM backend", \ +} + struct tpm_req_hdr { uint16_t tag; uint32_t len; Reviewed-by: Corey Bryant -- Regards, Corey Bryant

Re: [Qemu-devel] [RFC] Continuous work on sandboxing

2013-04-29 Thread Corey Bryant
ingle denied syscall at a time today via the audit log that the kernel issues. Eduardo, you may want to see if there's a good place to document that for QEMU so that people know where to look. -- Regards, Corey Bryant

Re: [Qemu-devel] [RFC] Continuous work on sandboxing

2013-04-29 Thread Corey Bryant
e() is denied, open() is denied (once the pre-req's are in place for fd passing), and potentially other "dangerous" syscalls are denied. If the whitelist for #2 was passed from libvirt to qemu then libvirt could define the syscalls and syscall parameters that are denied. -- Regards, Corey Bryant

Re: [Qemu-devel] [PATCH V19 1/7] Support for TPM command line options

2012-09-27 Thread Corey Bryant
" +#include "tpm.h" #include "dma.h" #include "audio/audio.h" #include "migration.h" @@ -2674,6 +2675,13 @@ int main(int argc, char **argv, char **envp) ram_size = value; break; } +#ifdef CONFIG_TPM +case QEMU_OPTION_tpmdev: +if (tpm_config_parse(qemu_find_opts("tpmdev"), optarg) < 0) { +exit(1); +} +break; +#endif case QEMU_OPTION_mempath: mem_path = optarg; break; @@ -3405,6 +3413,12 @@ int main(int argc, char **argv, char **envp) exit(1); } +#ifdef CONFIG_TPM +if (tpm_init() < 0) { +exit(1); +} +#endif + /* init the bluetooth world */ if (foreach_device_config(DEV_BT, bt_parse)) exit(1); @@ -3657,6 +3671,9 @@ int main(int argc, char **argv, char **envp) pause_all_vcpus(); net_cleanup(); res_free(); +#ifdef CONFIG_TPM +tpm_cleanup(); +#endif return 0; } -- Regards, Corey Bryant

Re: [Qemu-devel] [PATCH V19 3/7] Add a debug register

2012-09-27 Thread Corey Bryant
a register of the TIS interface * See specs pages 33-63 for description of the registers @@ -400,6 +465,11 @@ static uint64_t tpm_tis_mmio_read(void *opaque, target_phys_addr_t addr, case TPM_TIS_REG_RID: val = TPM_TIS_TPM_RID; break; +#ifdef DEBUG_TIS +case TPM_TIS_REG_DEBUG: +tpm_tis_dump_state(opaque, addr); +break; +#endif } if (shift) { This patch looks okay to me. -- Regards, Corey Bryant

Re: [Qemu-devel] [PATCH V19 4/7] Build the TPM frontend code

2012-09-27 Thread Corey Bryant
e SDL support" @@ -3911,6 +3916,12 @@ if test "$gprof" = "yes" ; then fi fi +if test "$tpm" = "yes"; then + if test "$target_softmmu" = "yes" ; then +echo "CONFIG_TPM=y" >> $config_host_mak + fi +fi + if test "$ARCH" = "tci"; then linker_script="" else This patch looks okay to me. -- Regards, Corey Bryant

Re: [Qemu-devel] [PATCH V19 2/7] Add TPM (frontend) hardware interface (TPM TIS) to Qemu

2012-09-27 Thread Corey Bryant
goto err_exit; +} + + isa_init_irq(dev, &tis->irq, tis->irq_num); + +memory_region_init_io(&s->mmio, &tpm_tis_memory_ops, s, "tpm-tis-mmio", + TPM_TIS_NUM_LOCALITIES << TPM_TIS_LOCALITY_SHIFT); +memory_region_add_subregion(get_system_memory(), TPM_TIS_ADDR_BASE, +&s->mmio); + +rc = tpm_tis_do_startup_tpm(s); +if (rc != 0) { +goto err_destroy_memory; +} + +return 0; + + err_destroy_memory: +memory_region_del_subregion(get_system_memory(), &s->mmio); +memory_region_destroy(&s->mmio); + + err_exit: +return -1; +} + +static const VMStateDescription vmstate_tpm_tis = { +.name = "tpm", +.unmigratable = 1, +}; + +static Property tpm_tis_properties[] = { +DEFINE_PROP_UINT32("irq", TPMState, + s.tis.irq_num, TPM_TIS_IRQ), +DEFINE_PROP_STRING("tpmdev", TPMState, backend), +DEFINE_PROP_END_OF_LIST(), +}; + +static void tpm_tis_class_initfn(ObjectClass *klass, void *data) +{ +DeviceClass *dc = DEVICE_CLASS(klass); +ISADeviceClass *ic = ISA_DEVICE_CLASS(klass); + +ic->init = tpm_tis_init; + +dc->props = tpm_tis_properties; +dc->reset = tpm_tis_reset; +dc->vmsd = &vmstate_tpm_tis; +} + +static TypeInfo tpm_tis_info = { +.name= "tpm-tis", +.parent = TYPE_ISA_DEVICE, +.class_init = tpm_tis_class_initfn, +.instance_size = sizeof(TPMState), +}; + +static void tpm_tis_register(void) +{ +type_register_static(&tpm_tis_info); +} + +type_init(tpm_tis_register) -- Regards, Corey Bryant

Re: [Qemu-devel] [PATCH V19 5/7] Add a TPM Passthrough backend driver implementation

2012-09-27 Thread Corey Bryant
nt tpm_config_parse(QemuOptsList *opts_list, const char *optarg); int tpm_init(void); void tpm_cleanup(void); TPMBackend *qemu_find_tpm(const char *id); void tpm_display_backend_drivers(void); const TPMDriverOps *tpm_get_backend_driver(const char *id); +void tpm_write_fatal_error_response(uint8_t *out, uint32_t out_len); + +extern const TPMDriverOps tpm_passthrough_driver; #endif /* QEMU_TPM_H */ diff --git a/vl.c b/vl.c index 3e784f5..6928e67 100644 --- a/vl.c +++ b/vl.c @@ -2676,11 +2676,13 @@ int main(int argc, char **argv, char **envp) break; } #ifdef CONFIG_TPM +# ifdef CONFIG_TPM_PASSTHROUGH case QEMU_OPTION_tpmdev: if (tpm_config_parse(qemu_find_opts("tpmdev"), optarg) < 0) { exit(1); } break; +# endif #endif case QEMU_OPTION_mempath: mem_path = optarg; -- Regards, Corey Bryant

Re: [Qemu-devel] [PATCH V19 6/7] Introduce --enable-tpm-passthrough configure option

2012-09-27 Thread Corey Bryant
ase upgrade to have SDL support" @@ -3919,7 +3931,9 @@ fi if test "$tpm" = "yes"; then if test "$target_softmmu" = "yes" ; then if test "$linux" = "yes" ; then - echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak + if test "$tpm_passthrough" = "yes" ; then +echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak + fi fi echo "CONFIG_TPM=y" >> $config_host_mak fi This patch looks okay to me. -- Regards, Corey Bryant

Re: [Qemu-devel] [PATCH V19 7/7] Add fd parameter for TPM passthrough driver

2012-09-27 Thread Corey Bryant
is optional. + Some notes about using the host's TPM with the passthrough driver: The TPM device accessed by the passthrough driver must not be diff --git a/tpm.c b/tpm.c index 79530c9..64d3140 100644 --- a/tpm.c +++ b/tpm.c @@ -201,6 +201,10 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv) res->path = g_strdup(drv->path); res->has_path = true; } +if (drv->tpm_fd != NULL && *drv->tpm_fd >= 0) { +res->fd = *drv->tpm_fd; +res->has_fd = true; +} res->type = g_strdup(drv->ops->id); return res; diff --git a/tpm.h b/tpm.h index bacaff3..00f7600 100644 --- a/tpm.h +++ b/tpm.h @@ -24,6 +24,7 @@ typedef struct TPMBackend { char *id; const char *fe_model; char *path; +int *tpm_fd; const TPMDriverOps *ops; union { This patch looks okay to me. -- Regards, Corey Bryant

Re: [Qemu-devel] [PATCH V19 0/7] Qemu Trusted Platform Module (TPM) integration

2012-09-27 Thread Corey Bryant
couple of general questions: I understand that the passthrough driver won't support migration. What happens on a migration attempt? Does it fail gracefully? What happens when a 2nd guest attempts to use the passthrough vTPM after the 1st guest is already using it? Does it also fail

Re: [Qemu-devel] [PATCH V19 2/7] Add TPM (frontend) hardware interface (TPM TIS) to Qemu

2012-10-03 Thread Corey Bryant
()/ -- Regards, Corey Bryant Testing the proper functioning of the different flags and localities cannot be done from user space when running in Linux for example, since access to the address space of the TPM TIS interface is not possible. Also the Linux driver itself does not exercise all functio

Re: [Qemu-devel] [PATCH V19 7/7] Add fd parameter for TPM passthrough driver

2012-10-03 Thread Corey Bryant
x27;s TPM using the passthrough driver. @@ -2049,6 +2050,10 @@ driver. a Linux host this would be @code{/dev/tpm0}. @option{path} is optional and by default @code{/dev/tpm0} is used. +@option{fd} specifies the file descriptor of the host's TPM device. +@option{fd} and @option{path} ar

[Qemu-devel] [PATCH 3/4] qemu-config: Add -drive fd and opaque options

2012-10-05 Thread Corey Bryant
opaque option is also available with add-fd, and allows a free-form string to be stored in the fd set along with the fd. Signed-off-by: Corey Bryant --- qemu-config.c | 8 qemu-options.hx | 15 +-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/qemu

[Qemu-devel] [PATCH 0/4] command line fd passing using fd sets

2012-10-05 Thread Corey Bryant
() already knows how to handle a filename of this format. qemu_open() searches the corresponding fd set for an fd and when it finds a match, QEMU goes on to use a dup of that fd just like it would have used an fd that it opened itself. Corey Bryant (4): monitor: Less restrictive fd matching f

[Qemu-devel] [PATCH 2/4] monitor: Enable adding an inherited fd to an fd set

2012-10-05 Thread Corey Bryant
allows the fd to remain in the fd set after probing of the image file. Signed-off-by: Corey Bryant --- monitor.c | 125 +++--- monitor.h | 3 ++ 2 files changed, 74 insertions(+), 54 deletions(-) diff --git a/monitor.c b/monitor.c index

[Qemu-devel] [PATCH 1/4] monitor: Less restrictive fd matching for fd sets

2012-10-05 Thread Corey Bryant
;/dev/fdset/2" with O_RDONLY or O_WRONLY, and an fd in fd set 2 has O_RDWR, the call will now be successful. Signed-off-by: Corey Bryant --- monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index a0e3ffb..34a968c 100644 --- a/monitor.c +++ b

[Qemu-devel] [PATCH 4/4] blockdev: Process -drive fd and opaque options

2012-10-05 Thread Corey Bryant
) searches the corresponding fd set for an fd and when it finds a match, QEMU goes on to use a dup of that fd just like it would have used an fd that it opened itself. Signed-off-by: Corey Bryant --- blockdev.c | 40 ++-- 1 file changed, 38 insertions(+), 2

Re: [Qemu-devel] [PATCH 0/4] command line fd passing using fd sets

2012-10-05 Thread Corey Bryant
On 10/05/2012 02:26 PM, Eric Blake wrote: On 10/05/2012 12:07 PM, Corey Bryant wrote: This series adds command line file descriptor passing support to the -drive option. This is a follow-on to the existing QMP fd passing support provided in the following patch series: comments.gmane.org

Re: [Qemu-devel] [PATCH 3/4] qemu-config: Add -drive fd and opaque options

2012-10-05 Thread Corey Bryant
On 10/05/2012 02:30 PM, Eric Blake wrote: On 10/05/2012 12:25 PM, Blue Swirl wrote: On Fri, Oct 5, 2012 at 6:07 PM, Corey Bryant wrote: These new options can be used for passing drive file descriptors on the command line, instead of using the file option to specify a file name. These new

Re: [Qemu-devel] [PATCH 3/4] qemu-config: Add -drive fd and opaque options

2012-10-05 Thread Corey Bryant
On 10/05/2012 02:25 PM, Blue Swirl wrote: On Fri, Oct 5, 2012 at 6:07 PM, Corey Bryant wrote: These new options can be used for passing drive file descriptors on the command line, instead of using the file option to specify a file name. These new command line options mirror the existing add

Re: [Qemu-devel] [PATCH 1/4] monitor: Less restrictive fd matching for fd sets

2012-10-05 Thread Corey Bryant
On 10/05/2012 02:35 PM, Eric Blake wrote: On 10/05/2012 12:07 PM, Corey Bryant wrote: Currently, in order to use a file descriptor that resides in an fd set, the access mode flag of the qemu_open() call has to be an exact match of the access mode flag of an fd in the requested fd set. This

Re: [Qemu-devel] [PATCH 3/4] qemu-config: Add -drive fd and opaque options

2012-10-05 Thread Corey Bryant
On 10/05/2012 02:51 PM, Eric Blake wrote: On 10/05/2012 12:44 PM, Corey Bryant wrote: Yes, this makes more sense. I'd like to mirror the add-fd QMP command as much as possible: { 'command': 'add-fd', 'data': {'*fdset-id': 'int', 

[Qemu-devel] [PATCH v2 0/3] command line fd passing using fd sets

2012-10-10 Thread Corey Bryant
QMP option as much as possible. Corey Bryant (3): monitor: Allow add-fd to any specified fd set monitor: Enable adding an inherited fd to an fd set qemu-config: Add new -add-fd command line option monitor.c| 131 +++ monitor.h

[Qemu-devel] [PATCH v2 2/3] monitor: Enable adding an inherited fd to an fd set

2012-10-10 Thread Corey Bryant
allows the fd to remain in the fd set after probing of the image file. Signed-off-by: Corey Bryant --- v2: - Removed Error** parameter from monitor_fdset_add_fd() monitor.c | 142 +- monitor.h | 2 + 2 files changed, 77 insertions(+), 67

[Qemu-devel] [PATCH v2 1/3] monitor: Allow add-fd to any specified fd set

2012-10-10 Thread Corey Bryant
The first call to add an fd to an fd set was previously not allowed to choose the fd set ID. The ID was generated as the first available and ensuing calls could add more fds by specifying the fd set ID. This change allows users to choose the fd set ID on the first call. Signed-off-by: Corey

[Qemu-devel] [PATCH v2 3/3] qemu-config: Add new -add-fd command line option

2012-10-10 Thread Corey Bryant
open() already knows how to handle a filename of this format. qemu_open() searches the corresponding fd set for an fd and when it finds a match, QEMU goes on to use a dup of that fd just like it would have used an fd that it opened itself. Signed-off-by: Corey Bryant --- v2: - The -add-fd opti

Re: [Qemu-devel] [PATCH v2 2/3] monitor: Enable adding an inherited fd to an fd set

2012-10-11 Thread Corey Bryant
On 10/10/2012 06:01 PM, Eric Blake wrote: On 10/10/2012 08:20 AM, Corey Bryant wrote: qmp_add_fd() gets an fd that was received over a socket with SCM_RIGHTS and adds it to an fd set. This patch adds support that will enable adding an fd that was inherited on the command line to an fd set

Re: [Qemu-devel] [PATCH v2 1/3] monitor: Allow add-fd to any specified fd set

2012-10-11 Thread Corey Bryant
On 10/10/2012 05:49 PM, Eric Blake wrote: On 10/10/2012 08:20 AM, Corey Bryant wrote: The first call to add an fd to an fd set was previously not allowed to choose the fd set ID. The ID was generated as the first available and ensuing calls could add more fds by specifying the fd set ID

Re: [Qemu-devel] [PATCH v2 3/3] qemu-config: Add new -add-fd command line option

2012-10-11 Thread Corey Bryant
On 10/10/2012 06:31 PM, Eric Blake wrote: On 10/10/2012 08:20 AM, Corey Bryant wrote: This option can be used for passing file descriptors on the command line. It mirrors the existing add-fd QMP command which allows an fd to be passed to QEMU via SCM_RIGHTS and added to an fd set. This can

Re: [Qemu-devel] [PATCH v2 2/3] monitor: Enable adding an inherited fd to an fd set

2012-10-11 Thread Corey Bryant
On 10/11/2012 07:25 AM, Kevin Wolf wrote: Am 10.10.2012 16:20, schrieb Corey Bryant: qmp_add_fd() gets an fd that was received over a socket with SCM_RIGHTS and adds it to an fd set. This patch adds support that will enable adding an fd that was inherited on the command line to an fd set

Re: [Qemu-devel] [feature request] qemu-bridge-helper

2012-10-11 Thread Corey Bryant
s not specified then we can default to tap0, etc. Richa, do you want to handle this? -- Regards, Corey Bryant

Re: [Qemu-devel] [PATCH v2 3/3] qemu-config: Add new -add-fd command line option

2012-10-11 Thread Corey Bryant
On 10/11/2012 11:55 AM, Eric Blake wrote: On 10/11/2012 08:45 AM, Corey Bryant wrote: Another missing validation check is for duplicate use. With the monitor command, you ALWAYS have a unique fd (thanks to SCM_RIGHTS). But with the command line, I can type 'qemu -add-fd fd=4,set=1 -a

Re: [Qemu-devel] [libvirt] [PATCH v2 3/3] qemu-config: Add new -add-fd command line option

2012-10-11 Thread Corey Bryant
gs will be even more important when passing fds on the command line. -- Regards, Corey Bryant

[Qemu-devel] [PATCH v3 1/4] monitor: Allow add-fd to any specified fd set

2012-10-16 Thread Corey Bryant
The first call to add an fd to an fd set was previously not allowed to choose the fd set ID. The ID was generated as the first available and ensuing calls could add more fds by specifying the fd set ID. This change allows users to choose the fd set ID on the first call. Signed-off-by: Corey

[Qemu-devel] [PATCH v3 2/4] monitor: Enable adding an inherited fd to an fd set

2012-10-16 Thread Corey Bryant
for non-valid fdset-id, is code motion from qmp_add_fd(). Signed-off-by: Corey Bryant --- v2: -Removed Error** parameter from monitor_fdset_add_fd() v3: -Added Error** parameter back to monitor_fdset_add_fd() -Move 'if (!mon_fdset_cur)' change to patch 1 (kw...@redhat.com)

[Qemu-devel] [PATCH v3 4/4] qemu-config: Add new -add-fd command line option

2012-10-16 Thread Corey Bryant
ith ID=2. qemu_open() already knows how to handle a filename of this format. qemu_open() searches the corresponding fd set for an fd and when it finds a match, QEMU goes on to use a dup of that fd just like it would have used an fd that it opened itself. Signed-off-by: Corey Bryant --- v2: - The -add-fd

[Qemu-devel] [PATCH v3 0/4] command line fd passing using fd sets

2012-10-16 Thread Corey Bryant
QMP option as much as possible. Corey Bryant (4): monitor: Allow add-fd to any specified fd set monitor: Enable adding an inherited fd to an fd set monitor: Prevent removing fd from set during init qemu-config: Add new -add-fd command line option monitor.c| 142

[Qemu-devel] [PATCH v3 3/4] monitor: Prevent removing fd from set during init

2012-10-16 Thread Corey Bryant
If an fd is added to an fd set via the command line, and it is not referenced by another command line option (ie. -drive), then clean it up after QEMU initialization is complete. Signed-off-by: Corey Bryant --- v3: - This patch was split into it's own patch in v3 (ebl...@redhat.co

Re: [Qemu-devel] [PATCH v3 0/4] command line fd passing using fd sets

2012-10-16 Thread Corey Bryant
On 10/16/2012 03:26 PM, Eric Blake wrote: On 10/16/2012 11:51 AM, Corey Bryant wrote: This series adds command line file descriptor passing support via a new -add-fd option. This is a follow-on to the existing QMP fd passing support provided in the following patch series: comments.gmane.org

Re: [Qemu-devel] Missing vhost=on support on -netdev bridge.

2014-01-09 Thread Corey Bryant
this: -net tap,helper="/usr/local/libexec/qemu-bridge-helper --br=br0" -- Regards, Corey Bryant

Re: [Qemu-devel] [RFC] Continuous work on sandboxing

2013-04-30 Thread Corey Bryant
On 04/30/2013 02:47 PM, Eduardo Otubo wrote: On 04/29/2013 07:02 PM, Corey Bryant wrote: On 04/29/2013 02:39 PM, Eduardo Otubo wrote: On 04/26/2013 06:07 PM, Paul Moore wrote: On Friday, April 26, 2013 03:39:33 PM Eduardo Otubo wrote: Hello folks, Resuming the sandboxing work, I&#

Re: [Qemu-devel] [RFC] Continuous work on sandboxing

2013-05-01 Thread Corey Bryant
On 05/01/2013 10:13 AM, Paul Moore wrote: On Tuesday, April 30, 2013 04:28:54 PM Corey Bryant wrote: Just to be clear, I'm thinking you could launch guests in one of two different seccomp sandboxed environments: 1) Using the existing and more permissive whitelist where every QEMU fe

Re: [Qemu-devel] [RFC] Continuous work on sandboxing

2013-05-01 Thread Corey Bryant
On 05/01/2013 01:25 PM, Eduardo Otubo wrote: On 04/30/2013 12:24 PM, Paul Moore wrote: On Monday, April 29, 2013 05:52:10 PM Corey Bryant wrote: On 04/26/2013 05:07 PM, Paul Moore wrote: [snip] 3. Debugging and/or learning mode - third party libraries still have the problem of

[Qemu-devel] [PATCH 2/7] vnvram: VNVRAM in-memory support

2013-05-23 Thread Corey Bryant
Provides support for in-memory VNVRAM entries. The in-memory entries are used for fast access to entry data such as the current or max size of an entry and the disk offset where an entry's binary blob data is stored. Signed-off-by: Corey Bryant --- vnvram.c |

[Qemu-devel] [PATCH 4/7] vnvram: VNVRAM internal APIs

2013-05-23 Thread Corey Bryant
Provides VNVRAM APIs that can be used by other areas of QEMU to provide persistent storage. Signed-off-by: Corey Bryant --- vnvram.c | 266 ++ vnvram.h | 14 +++ 2 files changed, 280 insertions(+), 0 deletions(-) diff --git a

[Qemu-devel] [PATCH 0/7] VNVRAM persistent storage

2013-05-23 Thread Corey Bryant
de0-0-0", false, &errcode); strcpy((char *)entry_name, "first-entry"); vnvram_register_entry(vnvram, &entry_name, 1024); vnvram_write_entry(vnvram, &entry_name, (char *)blob_w, strlen(blob_w)+1); vnvram_read_entry(vnvram, &entry_name, &blob_r, &blob_r_size); v

[Qemu-devel] [PATCH 3/7] vnvram: VNVRAM bottom-half r/w scheduling support

2013-05-23 Thread Corey Bryant
Provides support that schedules and executes VNVRAM read/write requests. A bottom-half is used to perform reads/writes from the QEMU main thread. Signed-off-by: Corey Bryant --- vnvram.c | 142 ++ 1 files changed, 142 insertions

[Qemu-devel] [PATCH 5/7] vnvram: VNVRAM additional debug support

2013-05-23 Thread Corey Bryant
Provides debug support that dumps the disk and in-memory VNVRAM contents to stderr. Signed-off-by: Corey Bryant --- vnvram.c | 94 ++ 1 files changed, 94 insertions(+), 0 deletions(-) diff --git a/vnvram.c b/vnvram.c index 357923d

[Qemu-devel] [PATCH 6/7] main: Initialize VNVRAM

2013-05-23 Thread Corey Bryant
Signed-off-by: Corey Bryant --- vl.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index 59dc0b4..5da88e6 100644 --- a/vl.c +++ b/vl.c @@ -171,6 +171,8 @@ int main(int argc, char **argv) #include "ui/qemu-spice.h" #include "qa

[Qemu-devel] [PATCH 7/7] monitor: QMP/HMP support for retrieving VNVRAM details

2013-05-23 Thread Corey Bryant
Signed-off-by: Corey Bryant --- hmp.c| 32 hmp.h|1 + monitor.c|7 + qapi-schema.json | 47 +++ qmp-commands.hx | 41 +++ vnvram.c | 71

[Qemu-devel] [PATCH 1/7] vnvram: VNVRAM bdrv support

2013-05-23 Thread Corey Bryant
Provides low-level VNVRAM functionality that reads and writes data, such as an entry's binary blob, to a drive image using the block driver. Signed-off-by: Corey Bryant --- Makefile.objs |2 + vnvram.c | 487 + vnv

Re: [Qemu-devel] [PATCH 7/7] monitor: QMP/HMP support for retrieving VNVRAM details

2013-05-23 Thread Corey Bryant
On 05/23/2013 01:59 PM, Eric Blake wrote: On 05/23/2013 11:44 AM, Corey Bryant wrote: Signed-off-by: Corey Bryant --- Might help to list a sample HMP or QMP usage in the commit message. +++ b/qapi-schema.json @@ -3619,3 +3619,50 @@ '*cpuid-input-ecx&#

Re: [Qemu-devel] [PATCH 0/7] VNVRAM persistent storage

2013-05-23 Thread Corey Bryant
On 05/23/2013 02:03 PM, Anthony Liguori wrote: Corey Bryant writes: This patch series provides VNVRAM persistent storage support that QEMU can use internally. The initial target user will be a software vTPM 1.2 backend that needs to store keys in VNVRAM and be able to reboot/migrate and

Re: [Qemu-devel] [PATCH 1/7] vnvram: VNVRAM bdrv support

2013-05-24 Thread Corey Bryant
On 05/24/2013 09:06 AM, Kevin Wolf wrote: Am 23.05.2013 um 19:44 hat Corey Bryant geschrieben: Provides low-level VNVRAM functionality that reads and writes data, such as an entry's binary blob, to a drive image using the block driver. Signed-off-by: Corey Bryant +/* + * Increas

Re: [Qemu-devel] [PATCH 0/7] VNVRAM persistent storage

2013-05-24 Thread Corey Bryant
On 05/23/2013 03:15 PM, Anthony Liguori wrote: Corey Bryant writes: On 05/23/2013 02:03 PM, Anthony Liguori wrote: Corey Bryant writes: One of the difficulties in virtualizing a TPM is that it doesn't support SR-IOV. So the existing passthrough vTPM can only be used by one

Re: [Qemu-devel] [PATCH 0/7] VNVRAM persistent storage

2013-05-24 Thread Corey Bryant
On 05/24/2013 08:36 AM, Stefan Hajnoczi wrote: On Fri, May 24, 2013 at 08:13:27AM -0400, Stefan Berger wrote: On 05/24/2013 05:59 AM, Stefan Hajnoczi wrote: On Thu, May 23, 2013 at 01:44:40PM -0400, Corey Bryant wrote: This patch series provides VNVRAM persistent storage support that QEMU

Re: [Qemu-devel] [PATCH 1/7] vnvram: VNVRAM bdrv support

2013-05-24 Thread Corey Bryant
On 05/24/2013 11:37 AM, Kevin Wolf wrote: Am 24.05.2013 um 17:33 hat Corey Bryant geschrieben: On 05/24/2013 09:06 AM, Kevin Wolf wrote: Am 23.05.2013 um 19:44 hat Corey Bryant geschrieben: Provides low-level VNVRAM functionality that reads and writes data, such as an entry's binary

Re: [Qemu-devel] [PATCH v3 3/4] monitor: Prevent removing fd from set during init

2012-10-18 Thread Corey Bryant
On 10/17/2012 12:02 AM, Eric Blake wrote: On 10/16/2012 12:08 PM, Corey Bryant wrote: If an fd is added to an fd set via the command line, and it is not referenced by another command line option (ie. -drive), then clean it up after QEMU initialization is complete. Signed-off-by: Corey Bryant

Re: [Qemu-devel] [PATCH v3 4/4] qemu-config: Add new -add-fd command line option

2012-10-18 Thread Corey Bryant
On 10/17/2012 12:16 AM, Eric Blake wrote: On 10/16/2012 12:10 PM, Corey Bryant wrote: This option can be used for passing file descriptors on the command line. It mirrors the existing add-fd QMP command which allows an fd to be passed to QEMU via SCM_RIGHTS and added to an fd set. This can

Re: [Qemu-devel] [PATCH v3 2/4] monitor: Enable adding an inherited fd to an fd set

2012-10-18 Thread Corey Bryant
On 10/17/2012 09:45 AM, Kevin Wolf wrote: Am 16.10.2012 20:08, schrieb Corey Bryant: qmp_add_fd() gets an fd that was received over a socket with SCM_RIGHTS and adds it to an fd set. This patch adds support that will enable adding an fd that was inherited on the command line to an fd set

<    1   2   3   4   5   6   >