Re: [Qemu-devel] [PATCH] Remove O_NOATIME flag from 9pfs open() calls in readonly mode

2012-01-24 Thread M. Mohan Kumar
Acked-by: M. Mohan Kumar On Monday, January 16, 2012 11:41:40 PM Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > When 2c74c2cb4bedddbfa67628fbd5f9273b4e0e9903 added support for > the 'readonly' flag against 9p filesystems, it also made QEMU > add

Re: [Qemu-devel] QEMU build errors with 'fdopendir'

2012-02-08 Thread M. Mohan Kumar
Hi, I will give a fix to disable virtfs by providing a configure option --disable-virtfs. But if you want use virtfs with your current setup, we can give the option to disable handle and proxy FS driver. Still you can use local FS driver. Meador Inge wrote: Did these [1] builds errors ever

Re: [Qemu-devel] [PATCH] virtfs-proxy-helper: check return code of setfsgid/setfsuid

2012-10-11 Thread M. Mohan Kumar
Stefan Weil writes: We need to change fsuid and fsgid in 9p server side when 9p client wants to create a file with given uid and gid. In my case setfsuid and setfsgid never return -1 even if a normal user tries to change fsuid. I am running F17 and glibc is 2.15-56.fc17 IMHO setfsuid/setfsgid

[Qemu-devel] [Bug 1018530] Re: No write access in a 9p/virtfs shared folder

2012-07-09 Thread M. Mohan Kumar
No, commit daf0b9aca9f67323266af1a92e8ea06f9d7bf408 added create support proxy FS driver model. Local FS had support for creating files much before. Georg, is qemu running with root user privileges? -- You received this bug notification because you are a member of qemu- devel-ml, which is subsc

[Qemu-devel] [Bug 1018530] Re: No write access in a 9p/virtfs shared folder

2012-07-10 Thread M. Mohan Kumar
Georg, pass-through security model needs root privilege, if you want to run qemu as non-root user either you have to use mapped security model or proxy fs driver. But libvirt does not have support for proxy FS driver. I posted a patch few months ago to libvirt for enabling the same. I will do the

Re: [Qemu-devel] [PATCH] virtfs-proxy-helper: check return code of setfsgid/setfsuid

2012-12-04 Thread M. Mohan Kumar
IDE, > }; > > -setfsgid(gid); > -setfsuid(uid); > +if (setresuid(-1, uid, suid) == -1) { > +retval = -errno; > +goto err_out; > +} > +if (setresgid(-1, gid, sgid) == -1) { > +retval = -errno; > +goto err_suid; > +} > After changing the order of setresuid and setresgid this patch works as expected. Please move setresgid before setresuid. Tested-by: M. Mohan Kumar

[Qemu-devel] [PATCH] fsdev: Don't ignore setfsuid/setfsgid return values

2012-10-05 Thread M. Mohan Kumar
From: "M. Mohan Kumar" In current implementation of setfsuid/setfsgid there is no way to know if it failed by checking the return value. This patch assumes setfsuid/setfsgid returns -1 in case of error. Eventually kernel code needs to be fixed. Signed-off-by: M. Mohan Kumar --- fs

Re: [Qemu-devel] 9pfs segfaults on chmod(special)

2013-02-28 Thread M. Mohan Kumar
Michael Tokarev writes: > 28.02.2013 13:12, Aneesh Kumar K.V wrote: >> Michael Tokarev writes: >> >>> When guest tries to chmod a block or char device file over 9pfs, >>> the qemu process segfaults. >>> >>> On host: >>> qemu-system-x86_64 -virtfs >>> local,path=/dev,security_model=mapped-file

Re: [Qemu-devel] 9pfs: unreadable dirs with random errors in guest

2013-02-28 Thread M. Mohan Kumar
Michael Tokarev writes: Hi, Please try mounting with -oversion=9p2000.L With qemu-1.4.0 and 9p2000.L, I could not recreate this issue. ie not getting Unknown error during directory listing. I am using Guest kernel 3.8.0-rc5+. > When I mount a 9pfs filesystem in guest with no write permission

Re: [Qemu-devel] 9pfs: unWRITAble dirs with random errors in guest

2013-02-28 Thread M. Mohan Kumar
Michael Tokarev writes: > 28.02.2013 17:55, M. Mohan Kumar wrote: >> Michael Tokarev writes: >> >> Hi, >> >> Please try mounting with -oversion=9p2000.L >> >> With qemu-1.4.0 and 9p2000.L, I could not recreate this issue. ie not >> gett

[Qemu-devel] [Bug 1130769] Re: VirtFS (virtio-9p-pci) error: Parameter 'driver' expects device type

2013-03-01 Thread M. Mohan Kumar
-fsdev can take local, handle and proxy. Could you please use try with one of them? -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1130769 Title: VirtFS (virtio-9p-pci) error: Parameter 'driver' exp

[Qemu-devel] [PATCH 1/1] block: Dont ignore previously set bdrv_flags

2013-08-14 Thread M. Mohan Kumar
From: "M. Mohan Kumar" bdrv_flags is set by bdrv_parse_discard_flags(), but later it is reset to zero. Signed-off-by: M. Mohan Kumar --- blockdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index e174b7d..bc7016a 100644 --- a/blockdev.c +++ b/

[Qemu-devel] [PATCH] Preserve S_ISGID

2011-12-27 Thread M. Mohan Kumar
From: "M. Mohan Kumar" In passthrough security model in local fs driver, after a file creation chown and chmod are done to set the file credentials and mode as requested by 9p client. But if there was a request to create a file with S_ISGID bit, doing chown on that file resets the S

[Qemu-devel] [PATCH] fsdev: parameter parsing for proxy helper

2012-01-19 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Signed-off-by: M. Mohan Kumar --- fsdev/virtfs-proxy-helper.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index baafee2..5aafc38 100644 --- a/fsdev/virtfs-proxy-help

[Qemu-devel] [RFC/PATCH] virtio-9p: Add Read only support for 9p export.

2011-05-23 Thread M. Mohan Kumar
A new fsdev parameter "access" is introduced to control accessing 9p export. access=ro|rw can be used to specify the access type. By default rw access is given to 9p export. Signed-off-by: M. Mohan Kumar --- fsdev/file-op-9p.h |1 + fsdev/qemu-fsdev.c

Re: [Qemu-devel] [RFC/PATCH] virtio-9p: Add Read only support for 9p export.

2011-05-23 Thread M. Mohan Kumar
On Mon, May 23, 2011 at 11:08:34AM +0100, Stefan Hajnoczi wrote: > On Mon, May 23, 2011 at 8:58 AM, M. Mohan Kumar wrote: > > A new fsdev parameter "access" is introduced to control accessing 9p export. > > access=ro|rw can be used to specify the access type. By default

[Qemu-devel] [PATCH V2] virtio-9p: Add Read only support for 9p export.

2011-05-24 Thread M. Mohan Kumar
A new fsdev parameter "readonly" is introduced to control accessing 9p export. readonly=on|off can be used to specify the access type. By default rw access is given to 9p export. Signed-off-by: M. Mohan Kumar --- Changes from previous version: * Use "readonly" option instead

[Qemu-devel] [PATCH V3] virtio-9p: Add Read only support for 9p export.

2011-05-24 Thread M. Mohan Kumar
A new fsdev parameter "readonly" is introduced to control accessing 9p export. readonly=on|off can be used to specify the access type. By default rw access is given to 9p export. Signed-off-by: M. Mohan Kumar --- Change from previous version V2: * QEMU_OPT_BOOL is used for readdonly

[Qemu-devel] [RFC PATCH] virtio-9p: Use clone approach to fix TOCTOU vulnerability

2011-06-14 Thread M. Mohan Kumar
operations are done from this thread to avoid TOCTTOU vulnerability. Signed-off-by: Venkateswararao Jujjuri Signed-off-by: M. Mohan Kumar --- fsdev/file-op-9p.h |1 + hw/9pfs/virtio-9p-coth.c | 105 +-- hw/9pfs/virtio-9p-coth.h | 13 +- hw

Re: [Qemu-devel] [RFC PATCH] virtio-9p: Use clone approach to fix TOCTOU vulnerability

2011-06-16 Thread M. Mohan Kumar
On Wed, Jun 15, 2011 at 10:10:00PM +0200, Andreas Färber wrote: > Am 14.06.2011 um 10:12 schrieb M. Mohan Kumar: > >> [RFC PATCH] virtio-9p: Use clone approach to fix TOCTOU vulnerability > > Subject doesn't need to be duplicated. Ok > >> In passthrough security

Re: [Qemu-devel] [RFC PATCH] virtio-9p: Use clone approach to fix TOCTOU vulnerability

2011-06-16 Thread M. Mohan Kumar
On Wed, Jun 15, 2011 at 04:24:12PM +0100, Stefan Hajnoczi wrote: > On Tue, Jun 14, 2011 at 9:12 AM, M. Mohan Kumar wrote: > > [RFC PATCH] virtio-9p: Use clone approach to fix TOCTOU vulnerability > > > > In passthrough security model, following a symbolic link in the server

[Qemu-devel] [Bug 965867] Re: 9p virtual file system on qemu slow

2012-04-25 Thread M. Mohan Kumar
Hi Max, Could you try passing msize=262144 for 9p mount point and post the results? Host: [root@llm116 media]# ls -lhas file 1.1G -rw-r--r-- 1 root root 1.0G Apr 26 11:05 file [root@llm116 media]# dd if=/dev/zero of=file bs=1M count=1024 1024+0 records in 1024+0 records out 1073741824 bytes (1.1

Re: [Qemu-devel] VirtIO 9p mount_tag (bogus?) limit of 32 bytes

2012-03-07 Thread M. Mohan Kumar
Hi Anthony, When I tried with ldconfig version 2.14.90, ldconfig successfully completed QEMU version: 1.0.50 Kernel version: 3.3.0-rc6+ Could you please try with recent ldconfig? On 02/22/2012 09:28 AM, C Anthony Risinger wrote: On Sat, Feb 18, 2012 at 11:38 AM, Aneesh Kumar K.V wrote: On

[Qemu-devel] [V11 06/15] virtio-9p: Create support in chroot environment

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add both chroot worker & qemu side interfaces to create regular files in chroot environment Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 36 hw/9pfs/virtio-9p-chroot.h|1 + hw/

[Qemu-devel] [V11 08/15] virtio-9p: Removing file or directory in chroot environment

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Support for removing file or directory in chroot environment. Add interfaces to remove file/directory in chroot worker and qemu side. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 18 ++ hw/9pfs/virtio-9p-chroot.h

[Qemu-devel] [V11 12/15] virtio-9p: chown in chroot environment

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add support to do chown in chroot process Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 18 ++ hw/9pfs/virtio-9p-chroot.h|1 + hw/9pfs/virtio-9p-local.c |9 + 3 files changed, 24 insert

[Qemu-devel] [V11 07/15] virtio-9p: Creating special files in chroot environment

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add both chroot worker and qemu side interfaces to create special files (directory, device nodes, links and symbolic links) Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 52 + hw/9pfs/virtio-9

[Qemu-devel] [V11 11/15] virtio-9p: chmod in chroot environment

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add support to do chmod operation in chroot process. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 18 ++ hw/9pfs/virtio-9p-chroot.h|1 + hw/9pfs/virtio-9p-local.c |5 +++-- 3 files changed, 22

[Qemu-devel] [V11 13/15] virtio-9p: stat in chroot environment

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 52 - hw/9pfs/virtio-9p-chroot.c| 59 - hw/9pfs/virtio-9p-chroot.h|3 ++ hw/9pfs/virtio-

[Qemu-devel] [V11 01/15] Implement qemu_read_full

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Signed-off-by: M. Mohan Kumar --- osdep.c | 32 qemu-common.h |2 ++ 2 files changed, 34 insertions(+), 0 deletions(-) diff --git a/osdep.c b/osdep.c index 56e6963..5a4d670 100644 --- a/osdep.c +++ b/osdep.c @@ -126

[Qemu-devel] [V11 00/15] virtio-9p: Use chroot to safely access files in passthrough security model

2011-06-24 Thread M. Mohan Kumar
* Split patchset based on chroot side (server) and qemu side(client) functionalities M. Mohan Kumar (15): Implement qemu_read_full virtio-9p: Enable CONFIG_THREAD if CONFIG_VIRTFS is enabled virtio-9p: Provide chroot worker side interfaces virtio-9p: Add qemu side interfaces for chroot

[Qemu-devel] [V11 03/15] virtio-9p: Provide chroot worker side interfaces

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Implement chroot worker side interfaces like sending the file descriptor to qemu process, reading the object request from socket etc. Also add chroot main function and other helper routines. Signed-off-by: M. Mohan Kumar [mala...@us.ibm.com: Do not send fd

[Qemu-devel] [V11 15/15] virtio-9p: Chroot environment for other functions

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add chroot functionality for system calls that can operate on a file using relative directory file descriptor. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-local.c | 41 +++-- 1 files changed, 39 insertions(+), 2

[Qemu-devel] [V11 02/15] virtio-9p: Enable CONFIG_THREAD if CONFIG_VIRTFS is enabled

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" 9p Chroot environment needs APIs defined in qemu-thread.c, so enable CONFIG_THREAD if virtfs is enabled Signed-off-by: M. Mohan Kumar --- configure |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure b/configure index df6340

[Qemu-devel] [V11 14/15] virtio-9p: readlink in chroot environment

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 17 ++--- hw/9pfs/virtio-9p-chroot.h|1 + hw/9pfs/virtio-9p-local.c | 14 -- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git

[Qemu-devel] [V11 10/15] virtio-9p: Move file post creation changes to none security model

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" After creating a file object, its permission and ownership details are updated as per 9p client's request for both passthrough and none security model. But with chrooted environment its not required for passthrough security model. Move all post file crea

[Qemu-devel] [V11 05/15] virtio-9p: Support for opening a file in chroot environment

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" This patch adds both chroot worker and qemu side support to open a file/ directory in the chroot environment Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot.c | 29 hw/9pfs/virtio-9p-chroot.h |2 +- hw/9pfs/virtio-9p-local

[Qemu-devel] [V11 09/15] virtio-9p: Rename in chroot environment

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Support renaming a file or directory in chroot envirnoment. Add interfaces for renaming in chroot worker and qemu side. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 17 + hw/9pfs/virtio-9p-chroot.h|1

[Qemu-devel] [V11 04/15] virtio-9p: qemu interfaces for chroot environment

2011-06-24 Thread M. Mohan Kumar
From: "M. Mohan Kumar" QEMU side interfaces to communicate with chroot worker process. Signed-off-by: M. Mohan Kumar [mala...@us.ibm.com: Handle when qemu process can not receive fd because it already reached max fds] --- Makefile.objs |2 +- hw/9pfs/virtio-9p-chroo

Re: [Qemu-devel] [V11 00/15] virtio-9p: Use chroot to safely access files in passthrough security model

2011-06-26 Thread M. Mohan Kumar
On Sun, Jun 26, 2011 at 09:22:27PM +0300, Blue Swirl wrote: > On Fri, Jun 24, 2011 at 11:22 AM, M. Mohan Kumar wrote: > > In passthrough security model, following symbolic links in the server > > side could result in TOCTTOU vulnerabilities. > > (http://en.wikipedia.org/wiki/

[Qemu-devel] [PATCH 1/2] qemu: Add opt_set_bool functionality

2011-10-19 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Signed-off-by: M. Mohan Kumar --- Changes from previous version: * Changed qemu_opt_{get|set}_bool to use 'bool' data type qemu-option.c | 43 +++ qemu-option.h |3 ++- 2 files changed, 41 insertions(+),

[Qemu-devel] [PATCH 2/2] hw/9pfs: Read-only support for 9p export

2011-10-19 Thread M. Mohan Kumar
From: "M. Mohan Kumar" A new fsdev parameter "readonly" is introduced to control accessing 9p export. readonly=on|off can be used to specify the access type. By default rw access is given to 9p export. Signed-off-by: M. Mohan Kumar --- Changes from previous version V4:

[Qemu-devel] [V3 PATCH 2/2] hw/9pfs: Read-only support for 9p export

2011-10-25 Thread M. Mohan Kumar
A new fsdev parameter "readonly" is introduced to control accessing 9p export. "readonly" can be used to specify the access type. By default "rw" access is given to 9p export. Signed-off-by: M. Mohan Kumar --- fsdev/file-op-9p.h |4 +++- fsdev/qemu-fsdev.c

[Qemu-devel] [V3 PATCH 1/2] qemu: Add opt_set_bool functionality

2011-10-25 Thread M. Mohan Kumar
Signed-off-by: M. Mohan Kumar --- Changes from previous version V2: * qemu_opt_set_bool does not need to call qemu_opt_parse, because it supports only setting boolean types Changes from previous version: * Changed qemu_opt_{get|set}_bool to use 'bool' data type qemu-optio

[Qemu-devel] [PATCH 01/13] hw/9pfs: Move opt validation to FsDriver callback

2011-10-31 Thread M. Mohan Kumar
From: "Aneesh Kumar K.V" This remove all conditional code from common code path and make opt validation a FSDriver callback. Signed-off-by: Aneesh Kumar K.V Signed-off-by: M. Mohan Kumar --- fsdev/file-op-9p.h | 15 +-- fsdev/qemu-fsdev.c

[Qemu-devel] [PATCH 04/13] hw/9pfs: File system helper process for qemu 9p proxy FS

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Provide root privilege access to QEMU 9p proxy filesystem using socket communication. Proxy helper is started by root user as: ~ # virtfs-proxy-helper {{-s|--socket -u|--uid -g|--gid}|{-f|--fd }} -p[-r -t ] Where uid:gid gives socket access to uid

[Qemu-devel] [PATCH 05/13] hw/9pfs: Add support to use named socket for proxy FS

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add option to use named socket for communicating between proxy helper and qemu proxy FS. Access to socket can be given by using command line options -u and -g. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtfs-proxy-helpe

[Qemu-devel] [PATCH 07/13] hw/9pfs: Create other filesystem objects

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add interfaces to create filesystem objects like directory, device nodes, symbolic links, links for proxy filesytem driver Signed-off-by: M. Mohan Kumar --- hw/9pfs/proxy.h |4 ++ hw/9pfs/virtfs-proxy-helper.c | 63 +

[Qemu-devel] [PATCH 09/13] hw/9pfs: File ownership and others

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add file ownership interfaces like chmod/chown, utime update, rename, remove and truncating files for proxy FS Signed-off-by: M. Mohan Kumar --- hw/9pfs/proxy.h |6 ++ hw/9pfs/virtfs-proxy-helper.c | 61 ++- hw/9pfs/virtio-

[Qemu-devel] [PATCH 13/13] hw/9pfs: man page for proxy helper

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Signed-off-by: M. Mohan Kumar --- Makefile | 12 ++- hw/9pfs/virtfs-proxy-helper.texi | 63 ++ 2 files changed, 74 insertions(+), 1 deletions(-) create mode 100644 hw/9pfs/virtfs-proxy-h

[Qemu-devel] [PATCH 12/13] hw/9pfs: Documentation changes related to proxy fs

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Signed-off-by: M. Mohan Kumar --- qemu-options.hx | 30 ++ 1 files changed, 22 insertions(+), 8 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 8df6165..eef98c5 100644 --- a/qemu-options.hx +++ b/qemu-

[Qemu-devel] [PATCH 08/13] hw/9pfs: Add stat/readlink/statfs for proxy FS

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Signed-off-by: M. Mohan Kumar --- hw/9pfs/proxy.h |3 ++ hw/9pfs/virtfs-proxy-helper.c | 81 - hw/9pfs/virtio-9p-proxy.c | 67 +++--- 3 files changed, 144 insert

[Qemu-devel] [PATCH 03/13] hw/9pfs: Add new proxy filesystem driver

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add new proxy filesystem driver to add root privilege to qemu process. It needs a helper process to be started by root user. Following command line can be used to utilize proxy filesystem driver -virtfs proxy,id=,mount_tag=,sock_fd= Signed-off-by: M. M

[Qemu-devel] [PATCH 02/13] hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Move p9 marshaling/unmarshaling code to a separate file so that proxy filesytem driver can use these calls. Also made marshaling code generic to accept "struct iovec" instead of V9fsPDU. Signed-off-by: M. Mohan Kumar Signed-off-by: Aneesh Kumar K.V

[Qemu-devel] [PATCH 00/13] Proxy FS driver for VirtFS

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Pass-through security model in QEMU 9p server needs root privilege to do few file operations (like chown, chmod to any mode/uid:gid). There are two issues in pass-through security model 1) TOCTTOU vulnerability: Following symbolic links in the server could prov

[Qemu-devel] [PATCH 10/13] hw/9pfs: xattr interfaces in proxy filesystem driver

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add xattr support for proxy FS Signed-off-by: M. Mohan Kumar --- hw/9pfs/proxy.h |4 ++ hw/9pfs/virtfs-proxy-helper.c | 60 hw/9pfs/virtio-9p-proxy.c | 121 ++--- 3 files ch

[Qemu-devel] [PATCH 06/13] hw/9pfs: Open and create files

2011-10-31 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Add interfaces to open and create files for proxy file system driver. Signed-off-by: M. Mohan Kumar --- Makefile |2 + configure |1 + hw/9pfs/proxy.h |6 ++ hw/9pfs/virtfs-proxy-helpe

[Qemu-devel] [PATCH V2 00/12] Proxy FS driver for VirtFS

2011-11-15 Thread M. Mohan Kumar
filesystem operations (like CAP_DAC_OVERRIDE, CAP_FOWNER etc) M. Mohan Kumar (12): hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file hw/9pfs: Add new proxy filesystem driver hw/9pfs: File system helper process for qemu 9p proxy FS hw/9pfs: Open and create files hw/9pfs: Create other

[Qemu-devel] [PATCH V2 07/12] hw/9pfs: File ownership and others

2011-11-15 Thread M. Mohan Kumar
Add file ownership interfaces like chmod/chown, utime update, rename, remove and truncating files for proxy FS Signed-off-by: M. Mohan Kumar --- Makefile|2 +- fsdev/virtfs-proxy-helper.c | 66 + hw/9pfs/virtio-9p-proxy.c | 134

[Qemu-devel] [PATCH V2 05/12] hw/9pfs: Create other filesystem objects

2011-11-15 Thread M. Mohan Kumar
Add interfaces to create filesystem objects like directory, device nodes, symbolic links, links for proxy filesytem driver Signed-off-by: M. Mohan Kumar --- fsdev/virtfs-proxy-helper.c | 105 -- hw/9pfs/virtio-9p-proxy.c | 173

[Qemu-devel] [PATCH V2 06/12] hw/9pfs: Add stat/readlink/statfs for proxy FS

2011-11-15 Thread M. Mohan Kumar
Signed-off-by: M. Mohan Kumar --- fsdev/virtfs-proxy-helper.c | 165 hw/9pfs/virtio-9p-proxy.c | 174 +-- hw/9pfs/virtio-9p-proxy.h | 34 + 3 files changed, 367 insertions(+), 6 deletions(-) diff

[Qemu-devel] [PATCH V2 02/12] hw/9pfs: Add new proxy filesystem driver

2011-11-15 Thread M. Mohan Kumar
Add new proxy filesystem driver to add root privilege to qemu process. It needs a helper process to be started by root user. Following command line can be used to utilize proxy filesystem driver -virtfs proxy,id=,mount_tag=,socket_fd= Signed-off-by: M. Mohan Kumar --- Makefile.objs

[Qemu-devel] [PATCH V2 12/12] hw/9pfs: Add support to use named socket for proxy FS

2011-11-15 Thread M. Mohan Kumar
ent to qemu and virtfs-proxy-helper. Also having a server like virtfs-proxy-helper listening on a pathname without any authentication is little bit scary. So we have to decide whether this patch is really needed. Signed-off-by: M. Mohan Kumar Signed-off-by: Aneesh Kumar K.V --- fsdev/file-o

[Qemu-devel] [PATCH V2 10/12] hw/9pfs: Documentation changes related to proxy fs

2011-11-15 Thread M. Mohan Kumar
Signed-off-by: M. Mohan Kumar --- qemu-options.hx | 25 - 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 681eaf1..cde17ed 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -530,19 +530,19 @@ DEFHEADING

[Qemu-devel] [PATCH V2 01/12] hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file

2011-11-15 Thread M. Mohan Kumar
Move p9 marshaling/unmarshaling code to a separate file so that proxy filesytem driver can use these calls. Also made marshaling code generic to accept "struct iovec" instead of V9fsPDU. Signed-off-by: M. Mohan Kumar --- Makefile.objs |2 +- fsdev/virtio-9p-marsha

Re: [Qemu-devel] [PATCH V2 00/12] Proxy FS driver for VirtFS

2011-11-15 Thread M. Mohan Kumar
Changes from previous version: 1) Communication between qemu and helper process is similar to 9p way of packing elements (pdu marshaling). M. Mohan Kumar wrote: Pass-through security model in QEMU 9p server needs root privilege to do few file operations (like chown, chmod to any mode/uid:gid

[Qemu-devel] [PATCH V2 11/12] hw/9pfs: man page for proxy helper

2011-11-15 Thread M. Mohan Kumar
Signed-off-by: M. Mohan Kumar --- Makefile | 12 +++- fsdev/virtfs-proxy-helper.texi | 59 2 files changed, 70 insertions(+), 1 deletions(-) create mode 100644 fsdev/virtfs-proxy-helper.texi diff --git a/Makefile b/Makefile

[Qemu-devel] [PATCH 00/12] Proxy FS driver for VirtFS

2011-11-15 Thread M. Mohan Kumar
filesystem operations (like CAP_DAC_OVERRIDE, CAP_FOWNER etc) M. Mohan Kumar (12): hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file hw/9pfs: Add new proxy filesystem driver hw/9pfs: File system helper process for qemu 9p proxy FS hw/9pfs: Open and create files hw/9pfs: Create other

[Qemu-devel] [PATCH V2 08/12] hw/9pfs: xattr interfaces in proxy filesystem driver

2011-11-15 Thread M. Mohan Kumar
Add xattr support for proxy FS Signed-off-by: M. Mohan Kumar --- fsdev/virtfs-proxy-helper.c | 78 - hw/9pfs/virtio-9p-proxy.c | 119 +++ hw/9pfs/virtio-9p-proxy.h |4 ++ 3 files changed, 190 insertions(+), 11

[Qemu-devel] [PATCH V2 09/12] hw/9pfs: Proxy getversion

2011-11-15 Thread M. Mohan Kumar
Add proxy getversion to get generation number Signed-off-by: M. Mohan Kumar --- fsdev/virtfs-proxy-helper.c | 74 +++ hw/9pfs/virtio-9p-proxy.c | 31 ++ hw/9pfs/virtio-9p-proxy.h |1 + 3 files changed, 106 insertions(+), 0

[Qemu-devel] [PATCH V2 04/12] hw/9pfs: Open and create files

2011-11-15 Thread M. Mohan Kumar
Add interfaces to open and create files for proxy file system driver. Signed-off-by: M. Mohan Kumar --- fsdev/virtfs-proxy-helper.c | 136 +++- hw/9pfs/virtio-9p-proxy.c | 180 +-- hw/9pfs/virtio-9p-proxy.h |9 ++ 3

[Qemu-devel] [PATCH V2 03/12] hw/9pfs: File system helper process for qemu 9p proxy FS

2011-11-15 Thread M. Mohan Kumar
Provide root privilege access to QEMU 9p proxy filesystem using socket communication. Proxy helper is started by root user as: ~ # virtfs-proxy-helper -f|--fd -p|--path Signed-off-by: M. Mohan Kumar --- Makefile|3 + configure | 19 +++ fsdev

Re: [Qemu-devel] [PATCH V2 03/12] hw/9pfs: File system helper process for qemu 9p proxy FS

2011-11-16 Thread M. Mohan Kumar
Stefan Hajnoczi wrote: On Tue, Nov 15, 2011 at 11:57 AM, M. Mohan Kumar wrote: diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c new file mode 100644 index 000..69daf7c --- /dev/null +++ b/fsdev/virtfs-proxy-helper.c @@ -0,0 +1,271 @@ +/* + * Helper for QEMU Proxy

[Qemu-devel] [PATCH V12 12/15] hw/9pfs: chown in chroot environment

2011-09-05 Thread M. Mohan Kumar
Add support to do chown in chroot process Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 18 ++ hw/9pfs/virtio-9p-chroot.h|1 + hw/9pfs/virtio-9p-local.c |9 + 3 files changed, 24 insertions(+), 4 deletions(-) diff --git

[Qemu-devel] [PATCH V12 10/15] hw/9pfs: Move file post creation changes to none security model

2011-09-05 Thread M. Mohan Kumar
igned-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-local.c | 25 + 1 files changed, 9 insertions(+), 16 deletions(-) diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c index 3b97f51..68551e2 100644 --- a/hw/9pfs/virtio-9p-local.c +++ b/hw/9pfs/virt

[Qemu-devel] [PATCH V12 13/15] hw/9pfs: stat in chroot environment

2011-09-05 Thread M. Mohan Kumar
Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 52 - hw/9pfs/virtio-9p-chroot.c| 59 - hw/9pfs/virtio-9p-chroot.h|3 ++ hw/9pfs/virtio-9p-local.c | 30

[Qemu-devel] [PATCH V12 11/15] hw/9pfs: chmod in chroot environment

2011-09-05 Thread M. Mohan Kumar
Add support to do chmod operation in chroot process. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 18 ++ hw/9pfs/virtio-9p-chroot.h|1 + hw/9pfs/virtio-9p-local.c |5 +++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff

[Qemu-devel] [PATCH V12 05/15] hw/9pfs: Support for opening a file in chroot environment

2011-09-05 Thread M. Mohan Kumar
This patch adds both chroot worker and qemu side support to open a file/ directory in the chroot environment Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot.c | 29 hw/9pfs/virtio-9p-chroot.h |2 +- hw/9pfs/virtio-9p-local.c | 79

[Qemu-devel] [PATCH V12 04/15] hw/9pfs: qemu interfaces for chroot environment

2011-09-05 Thread M. Mohan Kumar
QEMU side interfaces to communicate with chroot worker process. Signed-off-by: M. Mohan Kumar [mala...@us.ibm.com: Handle when qemu process can not receive fd because it already reached max fds] --- Makefile.objs |2 +- hw/9pfs/virtio-9p-chroot.c | 103

[Qemu-devel] [PATCH V12 02/15] hw/9pfs: Enable CONFIG_THREAD if CONFIG_VIRTFS is enabled

2011-09-05 Thread M. Mohan Kumar
9p Chroot environment needs APIs defined in qemu-thread.c, so enable CONFIG_THREAD if virtfs is enabled Signed-off-by: M. Mohan Kumar --- configure |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 1340c33..ad59fcc 100755 --- a/configure +++ b

[Qemu-devel] [PATCH V12 03/15] hw/9pfs: Provide chroot worker side interfaces

2011-09-05 Thread M. Mohan Kumar
Implement chroot worker side interfaces like sending the file descriptor to qemu process, reading the object request from socket etc. Also add chroot main function and other helper routines. Signed-off-by: M. Mohan Kumar [mala...@us.ibm.com: Do not send fd as part of data, instead a special

[Qemu-devel] [PATCH V12 06/15] hw/9pfs: Create support in chroot environment

2011-09-05 Thread M. Mohan Kumar
Add both chroot worker & qemu side interfaces to create regular files in chroot environment Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 36 hw/9pfs/virtio-9p-chroot.h|1 + hw/9pfs/virtio-9p-local.c |

[Qemu-devel] [PATCH V12 00/15] virtio-9p: chroot environment for passthrough security model

2011-09-05 Thread M. Mohan Kumar
fatal, ie qemu will exit * Split patchset based on chroot side (server) and qemu side(client) functionalities M. Mohan Kumar (15): Implement qemu_read_full virtio-9p: Enable CONFIG_THREAD if CONFIG_VIRTFS is enabled virtio-9p: Provide chroot worker side interfaces virtio-9p: qemu

[Qemu-devel] [PATCH V12 07/15] hw/9pfs: Creating special files in chroot environment

2011-09-05 Thread M. Mohan Kumar
Add both chroot worker and qemu side interfaces to create special files (directory, device nodes, links and symbolic links) Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 52 + hw/9pfs/virtio-9p-chroot.h|5 +++ hw/9pfs

[Qemu-devel] [PATCH V12 08/15] hw/9pfs: Removing file or directory in chroot environment

2011-09-05 Thread M. Mohan Kumar
Support for removing file or directory in chroot environment. Add interfaces to remove file/directory in chroot worker and qemu side. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 18 ++ hw/9pfs/virtio-9p-chroot.h|1 + hw/9pfs/virtio-9p

[Qemu-devel] [PATCH V12 01/15] Implement qemu_read_full

2011-09-05 Thread M. Mohan Kumar
Signed-off-by: M. Mohan Kumar --- osdep.c | 32 qemu-common.h |2 ++ 2 files changed, 34 insertions(+), 0 deletions(-) diff --git a/osdep.c b/osdep.c index 56e6963..5a4d670 100644 --- a/osdep.c +++ b/osdep.c @@ -126,6 +126,38 @@ ssize_t

[Qemu-devel] [PATCH V12 09/15] hw/9pfs: Rename in chroot environment

2011-09-05 Thread M. Mohan Kumar
Support renaming a file or directory in chroot envirnoment. Add interfaces for renaming in chroot worker and qemu side. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 17 + hw/9pfs/virtio-9p-chroot.h|1 + hw/9pfs/virtio-9p-local.c

[Qemu-devel] [PATCH V12 15/15] hw/9pfs: Chroot environment for other functions

2011-09-05 Thread M. Mohan Kumar
Add chroot functionality for system calls that can operate on a file using relative directory file descriptor. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-local.c | 41 +++-- 1 files changed, 39 insertions(+), 2 deletions(-) diff --git a/hw/9pfs

[Qemu-devel] [PATCH V12 14/15] hw/9pfs: readlink in chroot environment

2011-09-05 Thread M. Mohan Kumar
Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 17 ++--- hw/9pfs/virtio-9p-chroot.h|1 + hw/9pfs/virtio-9p-local.c | 14 -- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/hw/9pfs/virtio-9p-chroot-worker.c b

Re: [Qemu-devel] [PATCH V12 00/15] virtio-9p: chroot environment for passthrough security model

2011-09-12 Thread M. Mohan Kumar
On Tuesday, September 06, 2011 08:18:22 PM Stefan Hajnoczi wrote: > A virtfs feature that needs root therefore needs to be in a separate > process. Either QEMU needs to fork or virtfs could use a separate > daemon binary. > > You have already implemented the fork approach in the chroot

Re: [Qemu-devel] [PATCH V12 00/15] virtio-9p: chroot environment for passthrough security model

2011-09-12 Thread M. Mohan Kumar
> I agree, regardless of libvirt's needs, p9fs needs to be secure for any > non-root user using QEMU. As non-root I should be able todo > > $ qemu -virtfs $HOME/shared > > and have strong confidence that symlink attacks can't be used by the > guest to access other locations nuder $HOME. > > >

[Qemu-devel] [PATCH] hw/9pfs: Add open flag mapping

2011-09-15 Thread M. Mohan Kumar
Guest and the host may not be running same architecture. Hence fcntl flag mapping is needed. Signed-off-by: Venkateswararao Jujjuri Signed-off-by: Aneesh Kumar K.V Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p.c | 50 +- hw/9pfs/virtio

[Qemu-devel] [PATCH] virtio-9p: Use 9P specific Lock constants

2011-09-15 Thread M. Mohan Kumar
Use 9P specific lock constants instead of arch specific lock constants. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p.c |2 +- hw/9pfs/virtio-9p.h |6 ++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index 668ea24

Re: [Qemu-devel] [PATCH trivial] configure: explicitly disable virtfs if softmmu=no

2013-06-11 Thread M. Mohan Kumar
per.pod, > which can't be created because fsdev/ does not exist. > Hi, I tried ./configure --disable-system --enable-virtfs and make. But didnt face any build failure. Could you please share your build failure information? virtfs-proxy-helper.1 is created inside the fsdev folder.

Re: [Qemu-devel] [PATCH trivial] configure: explicitly disable virtfs if softmmu=no

2013-06-11 Thread M. Mohan Kumar
Peter Maydell writes: How about this approach? [PATCH] configure: Disable virtfs if softmmu not enabled Signed-off-by: M. Mohan Kumar --- configure | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 1654413..88c2b0f 100755 --- a

Re: [Qemu-devel] [PATCH trivial] configure: explicitly disable virtfs if softmmu=no

2013-06-11 Thread M. Mohan Kumar
Michael Tokarev writes: > 11.06.2013 21:23, M. Mohan Kumar wrote: >> Peter Maydell writes: >> >> How about this approach? > > Well, this is definitely wrong :) > >> -if test "$softmmu" = yes ; then >> - if test "$virtfs" != n

Re: [Qemu-devel] [PATCH] fsdev: Fix potential memory leak

2013-07-03 Thread M. Mohan Kumar
Stefan Weil writes: > This leak was reported by cppcheck. > > Signed-off-by: Stefan Weil Reviewed-by: M. Mohan Kumar > --- > fsdev/qemu-fsdev.c |2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c > index 6eaf36d..c

Re: [Qemu-devel] [PATCH] hw/9pfs: Fix potential memory leak and avoid reuse of freed memory

2013-07-04 Thread M. Mohan Kumar
Stefan Weil writes: > The leak was reported by cppcheck. > > Function proxy_init also calls g_free for ctx->fs_root. > Avoid reuse of this memory by setting ctx->fs_root to NULL. > > Signed-off-by: Stefan Weil Reviewed-by: M. Mohan Kumar > --- > > Hi, >

[Qemu-devel] [PATCH 1/1] hw/9pfs: Fix memory leak in error path

2013-07-04 Thread M. Mohan Kumar
From: "M. Mohan Kumar" Fix few more memory leaks in virtio-9p-device.c detected using valgrind. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-device.c | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/hw/9pfs/virtio-9p-device.c

[Qemu-devel] [RFC] Adding new filesystem 'proxy' to 9p

2011-09-28 Thread M. Mohan Kumar
ath=/tmp/,security_model=prox,mount_tag=v_pass People who want to use proxy_helper without libvirt can use following interface: $ proxy_helper -s -p <9p-path-to-export> With following qemu fsdev parameter: -virtfs proxy,id=,socket=,path=/tmp/, security_model=prox,mount_tag=v_pass -- Regards, M. Mohan Kumar

  1   2   3   >