Re: Status of DAX for virtio-fs/virtiofsd?

2023-05-18 Thread Vivek Goyal
On Wed, May 17, 2023 at 12:26:18PM -0400, Stefan Hajnoczi wrote: > On Wed, 17 May 2023 at 11:54, Alex Bennée wrote: > Hi Alex, > There were two unresolved issues: > > 1. How to inject SIGBUS when the guest accesses a page that's beyond > the end-of-file. > 2. Implementing the vhost-user messages

Re: Use of unshare(CLONE_FS) in virtiofsd

2022-11-04 Thread Vivek Goyal
ch, xfstests generic/062 passes on virtiofs. > > This fix is suggested by Miklos Szeredi and Stefan Hajnoczi. > The original discussion can be found here: > https://www.redhat.com/archives/virtio-fs/2019-October/msg00046.html > > Signed-off-by: Misono

Re: [Virtio-fs] virtiofsd: Any reason why there's not an "openat2" sandbox mode?

2022-10-05 Thread Vivek Goyal
On Mon, Oct 03, 2022 at 06:51:42PM -0400, Colin Walters wrote: > > > On Thu, Sep 29, 2022, at 1:03 PM, Vivek Goyal wrote: > > > > So rust version of virtiofsd, already supports running unprivileged > > (inside a user namespace). > > I know, but as I already s

Re: [Virtio-fs] virtiofsd: Any reason why there's not an "openat2" sandbox mode?

2022-09-29 Thread Vivek Goyal
On Thu, Sep 29, 2022 at 11:47:32AM -0400, Colin Walters wrote: > > > On Thu, Sep 29, 2022, at 10:10 AM, Vivek Goyal wrote: > > > What's your use case. How do you plan to use virtiofs. > > At the current time, the Kubernetes that we run does not support user >

Re: [Virtio-fs] virtiofsd: Any reason why there's not an "openat2" sandbox mode?

2022-09-29 Thread Vivek Goyal
On Thu, Sep 29, 2022 at 10:04:36AM -0400, Colin Walters wrote: > On Wed, Sep 28, 2022, at 3:28 PM, Vivek Goyal wrote: > > > Sounds reasonable. In fact, we could probably do someting similar > > for "landlock" as well. > > Thanks for the discussion all! Ca

Re: [Virtio-fs] virtiofsd: Any reason why there's not an "openat2" sandbox mode?

2022-09-28 Thread Vivek Goyal
On Wed, Sep 28, 2022 at 10:33:40AM +0200, Sergio Lopez wrote: > On Tue, Sep 27, 2022 at 04:14:20PM -0400, Stefan Hajnoczi wrote: > > On Tue, Sep 27, 2022 at 01:51:41PM -0400, Colin Walters wrote: > > > > > > > > > On Tue, Sep 27, 2022, at 1:27 PM, German Maglione wrote: > > > > > > > >> > Now

Re: virtiofsd: Any reason why there's not an "openat2" sandbox mode?

2022-09-28 Thread Vivek Goyal
On Tue, Sep 27, 2022 at 07:27:02PM +0200, German Maglione wrote: > On Tue, Sep 27, 2022 at 6:57 PM Vivek Goyal wrote: > > > > On Tue, Sep 27, 2022 at 12:37:15PM -0400, Vivek Goyal wrote: > > > On Fri, Sep 09, 2022 at 05:24:03PM -0400, Colin Walters wrote: > > >

Re: virtiofsd: Any reason why there's not an "openat2" sandbox mode?

2022-09-27 Thread Vivek Goyal
On Tue, Sep 27, 2022 at 12:37:15PM -0400, Vivek Goyal wrote: > On Fri, Sep 09, 2022 at 05:24:03PM -0400, Colin Walters wrote: > > We previously had a chat here > > https://lore.kernel.org/all/348d4774-bd5f-4832-bd7e-a21491fda...@www.fastmail.com/T/ > > around virtiofsd and pr

Re: virtiofsd: Any reason why there's not an "openat2" sandbox mode?

2022-09-27 Thread Vivek Goyal
On Fri, Sep 09, 2022 at 05:24:03PM -0400, Colin Walters wrote: > We previously had a chat here > https://lore.kernel.org/all/348d4774-bd5f-4832-bd7e-a21491fda...@www.fastmail.com/T/ > around virtiofsd and privileges and the case of trying to run virtiofsd > inside an unprivileged (Kubernetes)

Re: [Virtio-fs] [PATCH] virtiofsd: use g_date_time_get_microsecond to get subsecond

2022-09-20 Thread Vivek Goyal
On Wed, Aug 24, 2022 at 01:41:29PM -0400, Stefan Hajnoczi wrote: > On Thu, Aug 18, 2022 at 02:46:19PM -0400, Yusuke Okada wrote: > > From: Yusuke Okada > > > > The "%f" specifier in g_date_time_format() is only available in glib > > 2.65.2 or later. If combined with older glib, the function

[PATCH] virtiofsd: Disable killpriv_v2 by default

2022-07-29 Thread Vivek Goyal
this patch disabled killpriv_v2 by default. User can choose to enable it by passing option "-o killpriv_v2". Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) Index: rhvgoyal-qemu/tools/virtiofsd/passth

Re: Question about performance comparison between virtio-fs and virtio-blk

2022-07-26 Thread Vivek Goyal
On Tue, Jul 26, 2022 at 10:41:23PM +0800, Hao Xu wrote: > On 7/26/22 21:17, Vivek Goyal wrote: > > On Tue, Jul 26, 2022 at 08:55:38AM -0400, Stefan Hajnoczi wrote: > > > On Tue, 26 Jul 2022 at 08:24, Hao Xu wrote: > > > > I watched your presentation about virtiofs i

Re: Question about performance comparison between virtio-fs and virtio-blk

2022-07-26 Thread Vivek Goyal
> > virtio-blk and virtio-fs are similar. > Hi Hao, My impression in general is that virtio-blk is much faster than virtiofs. A simple macro test is do a kernel compilation and compare time taken between the two. > I have CCed Vivek Goyal, who has done more virtiofs benchmarking an

Re: [Virtio-fs] [Qemu] how to use viriofs in qemu without NUMA

2022-07-12 Thread Vivek Goyal
On Tue, Jul 12, 2022 at 07:06:50AM +, Zhao, Shirley wrote: > Hi, all, > > I have another question want to consult you. > To enable DAX in virtiofs, according to the memu > https://virtio-fs.gitlab.io/howto-qemu.html. > I need to add "cache-size=2G" as below. > -device

Re: [PATCH] docs: Correct the default thread-pool-size

2022-04-14 Thread Vivek Goyal
workloads it performed better. When multiple threads are doing parallel I/O then, thread pool helps. So people who want to do lots of parallel I/O should manually enable thread pool. Acked-by: Vivek Goyal Vivek > --- > docs/tools/virtiofsd.rst | 2 +- > 1 file changed, 1 insert

Re: [PULL 09/12] virtiofsd: Create new file with security context

2022-04-07 Thread Vivek Goyal
On Thu, Apr 07, 2022 at 01:44:35PM +0100, Dr. David Alan Gilbert wrote: > * Peter Maydell (peter.mayd...@linaro.org) wrote: > > On Thu, 17 Feb 2022 at 17:40, Dr. David Alan Gilbert (git) > > wrote: > > > > > > From: Vivek Goyal > > > > >

Re: [PATCH 0/2] virtiofsd: Support FUSE_SYNCFS on unannounced submounts

2022-03-04 Thread Vivek Goyal
On Thu, Mar 03, 2022 at 06:13:21PM +0100, Greg Kurz wrote: > This is the current patches I have : one to track submounts > and the other to call syncfs() on them. Tested on simple > cases only. > > I won't be able to work on this anymore, so I'm posting for the > records. Anyone is welcome to

Re: [Virtio-fs] [PULL 00/12] virtiofs queue

2022-02-16 Thread Vivek Goyal
e. This works basically for SELinux and its per thread. This patch just introduces the helper functions. Subsequent patches will make use of these helpers. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 92

Re: [PATCH v6 1/1] virtiofsd: Add basic support for FUSE_SYNCFS request

2022-02-15 Thread Vivek Goyal
rnally and call > syncfs() on each of them. This will be implemented later. > > Note that syncfs() might suffer from a time penalty if the submounts > are being hammered by some unrelated workload on the host. The only > solution to prevent that is to avoid shared mounts. > > Signed-off-by: Greg

Re: [PATCH v5 3/3] virtiofsd: Add support for FUSE_SYNCFS request without announce_submounts

2022-02-15 Thread Vivek Goyal
On Tue, Feb 15, 2022 at 10:18:03AM +0100, Greg Kurz wrote: > On Mon, 14 Feb 2022 14:09:47 -0500 > Vivek Goyal wrote: > > > On Mon, Feb 14, 2022 at 01:56:08PM -0500, Vivek Goyal wrote: > > > On Mon, Feb 14, 2022 at 01:27:22PM -0500, Vivek Goyal wrote: > > > >

Re: [PATCH v5 3/3] virtiofsd: Add support for FUSE_SYNCFS request without announce_submounts

2022-02-14 Thread Vivek Goyal
On Mon, Feb 14, 2022 at 01:56:08PM -0500, Vivek Goyal wrote: > On Mon, Feb 14, 2022 at 01:27:22PM -0500, Vivek Goyal wrote: > > On Mon, Feb 14, 2022 at 02:58:20PM +0100, Greg Kurz wrote: > > > This adds the missing bits to support FUSE_SYNCFS in the case submounts >

Re: [PATCH v5 3/3] virtiofsd: Add support for FUSE_SYNCFS request without announce_submounts

2022-02-14 Thread Vivek Goyal
On Mon, Feb 14, 2022 at 01:27:22PM -0500, Vivek Goyal wrote: > On Mon, Feb 14, 2022 at 02:58:20PM +0100, Greg Kurz wrote: > > This adds the missing bits to support FUSE_SYNCFS in the case submounts > > aren't announced to the client. > > > > Iterate over all inodes an

Re: [PATCH v5 3/3] virtiofsd: Add support for FUSE_SYNCFS request without announce_submounts

2022-02-14 Thread Vivek Goyal
On Mon, Feb 14, 2022 at 02:58:20PM +0100, Greg Kurz wrote: > This adds the missing bits to support FUSE_SYNCFS in the case submounts > aren't announced to the client. > > Iterate over all inodes and call syncfs() on the ones marked as submounts. > Since syncfs() can block for an indefinite time,

Re: [PATCH v2] Deprecate C virtiofsd

2022-02-14 Thread Vivek Goyal
On Mon, Feb 14, 2022 at 11:30:03AM +, Dr. David Alan Gilbert wrote: > * Richard W.M. Jones (rjo...@redhat.com) wrote: > > On Thu, Feb 10, 2022 at 05:47:14PM +, Dr. David Alan Gilbert (git) > > wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > There's a nice new Rust implementation

Re: [PATCH v6 10/10] virtiofsd: Add an option to enable/disable security label

2022-02-14 Thread Vivek Goyal
On Mon, Feb 14, 2022 at 01:32:38PM +, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > Provide an option "-o security_label/no_security_label" to enable/disable > > security label functionality. By default these are turned off. &g

Re: [PATCH] Deprecate C virtiofsd

2022-02-09 Thread Vivek Goyal
On Wed, Feb 09, 2022 at 04:50:40PM +, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > There's a nice new Rust implementation out there; recommend people > do new work on that. > > Signed-off-by: Dr. David Alan Gilbert Acked-by: Vivek

Re: [Virtio-fs] [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-09 Thread Vivek Goyal
On Wed, Feb 09, 2022 at 11:24:29AM +0100, German Maglione wrote: > On Tue, Feb 8, 2022 at 11:44 PM Daniel P. Berrangé > wrote: > > > On Mon, Feb 07, 2022 at 04:19:38PM -0500, Vivek Goyal wrote: > > > On Mon, Feb 07, 2022 at 01:05:16PM +, Daniel P. Berrangé wrote: >

[PATCH v6 06/10] virtiofsd: Move core file creation code in separate function

2022-02-08 Thread Vivek Goyal
Move core file creation bits in a separate function. Soon this is going to get more complex as file creation need to set security context also. And there will be multiple modes of file creation in next patch. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd

[PATCH v6 00/10] virtiofsd: Add support for file security context at file creation

2022-02-08 Thread Vivek Goyal
- Split patch 7 in the series. Some of the handling of setting and clearing fscreate knob has been moved into a separate patch. Found it hard to break it down further. So it helps a bit but not too much. (David Gilbert). Thanks Vivek Vivek Goyal (10): virtiofsd: Fix breakage due to fuse_i

[PATCH v6 02/10] linux-headers: Update headers to v5.17-rc1

2022-02-08 Thread Vivek Goyal
Update headers to 5.17-rc1. I need latest fuse changes. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- include/standard-headers/asm-x86/kvm_para.h | 1 + include/standard-headers/drm/drm_fourcc.h | 11 ++ include/standard-headers/linux/ethtool.h | 1

[PATCH v6 09/10] virtiofsd: Create new file using O_TMPFILE and set security context

2022-02-08 Thread Vivek Goyal
e fallback to non-atomic behavior. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 80 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_

[PATCH v6 10/10] virtiofsd: Add an option to enable/disable security label

2022-02-08 Thread Vivek Goyal
a SELinux label. File server will set this label on the file. It will try to set it atomically wherever possible. But its not possible in all the cases. Signed-off-by: Vivek Goyal --- docs/tools/virtiofsd.rst | 32 tools/virtiofsd/helper.c |

[PATCH v6 04/10] virtiofsd: Extend size of fuse_conn_info->capable and ->want fields

2022-02-08 Thread Vivek Goyal
fields are not suffcient anymore. Increase size to 64 bit so that we can add newer capabilities and still be able to use existing code to check and set the capabilities. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_common.h | 4 ++-- tools/virtiofsd/fuse_lowl

[PATCH v6 07/10] virtiofsd: Add helpers to work with /proc/self/task/tid/attr/fscreate

2022-02-08 Thread Vivek Goyal
. This works basically for SELinux and its per thread. This patch just introduces the helper functions. Subsequent patches will make use of these helpers. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 92 1 file

[PATCH v6 03/10] virtiofsd: Parse extended "struct fuse_init_in"

2022-02-08 Thread Vivek Goyal
Add some code to parse extended "struct fuse_init_in". And use a local variable "flag" to represent 64 bit flags. This will make it easier to add more features without having to worry about two 32bit flags (->flags and ->flags2) in "fuse_struct_in". Si

[PATCH v6 01/10] virtiofsd: Fix breakage due to fuse_init_in size change

2022-02-08 Thread Vivek Goyal
posted which will parse rest of the bytes and enable new functionality. Right now we don't support any of the new functionality, so we don't lose anything by not parsing bytes beyond 16. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_lowlevel.c | 3 ++- 1 fi

[PATCH v6 08/10] virtiofsd: Create new file with security context

2022-02-08 Thread Vivek Goyal
es. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 229 +++ 1 file changed, 200 insertions(+), 29 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 7762bf0d2

[PATCH v6 05/10] virtiofsd, fuse_lowlevel.c: Add capability to parse security context

2022-02-08 Thread Vivek Goyal
Add capability to enable and parse security context as sent by client and put into fuse_req. Filesystems now can get security context from request and set it on files during creation. Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_common.h | 5 ++ tools/virtiofsd/fuse_i.h| 7

Re: [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-07 Thread Vivek Goyal
On Mon, Feb 07, 2022 at 01:05:16PM +, Daniel P. Berrangé wrote: > On Wed, Feb 02, 2022 at 02:39:26PM -0500, Vivek Goyal wrote: > > Hi, > > > > This is V5 of the patches. I posted V4 here. > > > > https://listman.redhat.com/archives/vir

Re: [PATCH v4 09/11] 9p: darwin: Implement compatibility for mknodat

2022-02-07 Thread Vivek Goyal
On Mon, Feb 07, 2022 at 11:49:12AM +0100, Greg Kurz wrote: > On Mon, 7 Feb 2022 11:30:18 +0100 > Philippe Mathieu-Daudé wrote: > > > On 7/2/22 09:47, Greg Kurz wrote: > > > On Sun, 6 Feb 2022 20:10:23 -0500 > > > Will Cohen wrote: > > > > > >> This patch set currently places it in 9p-util only

Re: [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-07 Thread Vivek Goyal
On Mon, Feb 07, 2022 at 01:30:16PM +, Daniel P. Berrangé wrote: > On Mon, Feb 07, 2022 at 08:24:08AM -0500, Vivek Goyal wrote: > > On Mon, Feb 07, 2022 at 01:05:16PM +, Daniel P. Berrangé wrote: > > > On Wed, Feb 02, 2022 at 02:39:26PM -0500, Vivek Goyal

Re: [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-07 Thread Vivek Goyal
On Mon, Feb 07, 2022 at 12:49:24PM +, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > Hi, > > > > This is V5 of the patches. I posted V4 here. > > > > https://listman.redhat.com/archives/virtio-fs/2022-January/msg00041.html > &

Re: [PATCH v5 9/9] virtiofsd: Add an option to enable/disable security label

2022-02-07 Thread Vivek Goyal
On Mon, Feb 07, 2022 at 12:40:21PM +, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > Provide an option "-o security_label/no_security_label" to enable/disable > > security label functionality. By default these are turned off. &g

Re: [PATCH v5 7/9] virtiofsd: Create new file with fscreate set

2022-02-07 Thread Vivek Goyal
On Mon, Feb 07, 2022 at 11:38:12AM +, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > This patch adds support to set /proc/thread-self/attr/fscreate before > > file creation. It is set to a value as sent by client. This will allow > >

Re: [PATCH v5 5/9] virtiofsd, fuse_lowlevel.c: Add capability to parse security context

2022-02-07 Thread Vivek Goyal
On Thu, Feb 03, 2022 at 07:41:27PM +, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > Add capability to enable and parse security context as sent by client > > and put into fuse_req. Filesystems now can get security context from > > reques

Re: [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-07 Thread Vivek Goyal
On Mon, Feb 07, 2022 at 01:05:16PM +, Daniel P. Berrangé wrote: > On Wed, Feb 02, 2022 at 02:39:26PM -0500, Vivek Goyal wrote: > > Hi, > > > > This is V5 of the patches. I posted V4 here. > > > > https://listman.redhat.com/archives/vir

Re: [PATCH v5 3/9] virtiofsd: Parse extended "struct fuse_init_in"

2022-02-07 Thread Vivek Goyal
On Thu, Feb 03, 2022 at 06:56:58PM +, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > Add some code to parse extended "struct fuse_init_in". And use a local > > variable "flag" to represent 64 bit flags. This will make it easi

[PATCH v5 5/9] virtiofsd, fuse_lowlevel.c: Add capability to parse security context

2022-02-02 Thread Vivek Goyal
Add capability to enable and parse security context as sent by client and put into fuse_req. Filesystems now can get security context from request and set it on files during creation. Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_common.h | 5 ++ tools/virtiofsd/fuse_i.h| 7

[PATCH v5 4/9] virtiofsd: Extend size of fuse_conn_info->capable and ->want fields

2022-02-02 Thread Vivek Goyal
fields are not suffcient anymore. Increase size to 64 bit so that we can add newer capabilities and still be able to use existing code to check and set the capabilities. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_common.h | 4 ++-- tools/virtiofsd/fuse_lowl

[PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-02 Thread Vivek Goyal
and code remains git bisectable. (David Gilbert) - Changed %lx to %llx at one place. (David Gilbert). Thanks Vivek Vivek Goyal (9): virtiofsd: Fix breakage due to fuse_init_in size change linux-headers: Update headers to v5.17-rc1 virtiofsd: Parse extended "struct fuse_init_in"

[PATCH v5 2/9] linux-headers: Update headers to v5.17-rc1

2022-02-02 Thread Vivek Goyal
Update headers to 5.17-rc1. I need latest fuse changes. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- include/standard-headers/asm-x86/kvm_para.h | 1 + include/standard-headers/drm/drm_fourcc.h | 11 ++ include/standard-headers/linux/ethtool.h | 1

[PATCH v5 7/9] virtiofsd: Create new file with fscreate set

2022-02-02 Thread Vivek Goyal
and guest policies are in sync and don't conflict. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 317 --- 1 file changed, 290 insertions(+), 27 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index

[PATCH v5 3/9] virtiofsd: Parse extended "struct fuse_init_in"

2022-02-02 Thread Vivek Goyal
Add some code to parse extended "struct fuse_init_in". And use a local variable "flag" to represent 64 bit flags. This will make it easier to add more features without having to worry about two 32bit flags (->flags and ->flags2) in "fuse_struct_in". Si

[PATCH v5 6/9] virtiofsd: Move core file creation code in separate function

2022-02-02 Thread Vivek Goyal
Move core file creation bits in a separate function. Soon this is going to get more complex as file creation need to set security context also. And there will be multiple modes of file creation in next patch. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd

[PATCH v5 9/9] virtiofsd: Add an option to enable/disable security label

2022-02-02 Thread Vivek Goyal
a SELinux label. File server will set this label on the file. It will try to set it atomically wherever possible. But its not possible in all the cases. Signed-off-by: Vivek Goyal --- docs/tools/virtiofsd.rst | 7 +++ tools/virtiofsd/helper.c | 1 + tools/virtiofsd/passthrough

[PATCH v5 8/9] virtiofsd: Create new file using O_TMPFILE and set security context

2022-02-02 Thread Vivek Goyal
e fallback to non-atomic behavior. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 80 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index acb99aa2fc..43c9b6d

[PATCH v5 1/9] virtiofsd: Fix breakage due to fuse_init_in size change

2022-02-02 Thread Vivek Goyal
posted which will parse rest of the bytes and enable new functionality. Right now we don't support any of the new functionality, so we don't lose anything by not parsing bytes beyond 16. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_lowlevel.c | 3 ++- 1 fi

Re: [PATCH v4 3/9] virtiofsd: Parse extended "struct fuse_init_in"

2022-01-27 Thread Vivek Goyal
On Thu, Jan 27, 2022 at 05:50:50PM +, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > Add some code to parse extended "struct fuse_init_in". And use a local > > variable "flag" to represent 64 bit flags. This will make it easi

Re: [PATCH v4 4/9] virtiofsd: Extend size of fuse_conn_info->capable and ->want fields

2022-01-27 Thread Vivek Goyal
On Thu, Jan 27, 2022 at 05:53:20PM +, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > ->capable keeps track of what capabilities kernel supports and ->wants keep > > track of what capabilities filesytem wants. > > > > Right n

Re: [PATCH v4 1/9] linux-headers: Update headers to v5.17-rc1

2022-01-27 Thread Vivek Goyal
On Thu, Jan 27, 2022 at 05:21:02PM +, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > Update headers to 5.17-rc1. I need latest fuse changes. > > > > Signed-off-by: Vivek Goyal > > Can you just confirm that this lot was generated

Re: [Virtio-fs] [PATCH v4 1/2] virtiofsd: Track mounts

2022-01-26 Thread Vivek Goyal
On Wed, Jan 26, 2022 at 05:47:09PM -0500, Vivek Goyal wrote: > On Tue, Jan 25, 2022 at 03:12:11PM +0100, Greg Kurz wrote: > > The upcoming implementation of ->sync_fs() needs to know about all > > submounts in order to call syncfs() on them when virtiofsd is start

Re: [PATCH v4 1/2] virtiofsd: Track mounts

2022-01-26 Thread Vivek Goyal
On Tue, Jan 25, 2022 at 03:12:11PM +0100, Greg Kurz wrote: > The upcoming implementation of ->sync_fs() needs to know about all > submounts in order to call syncfs() on them when virtiofsd is started > without '-o announce_submounts'. > > Track every inode that comes up with a new mount id in a

[PATCH] virtiofsd: Drop membership of all supplementary groups (CVE-2022-0358)

2022-01-25 Thread Vivek Goyal
/show_bug.cgi?id=2044863 Fixes: CVE-2022-0358 Reported-by: JIETAO XIAO Suggested-by: Miklos Szeredi Reviewed-by: Stefan Hajnoczi Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 26 ++ 1 file changed, 26 insertions(

[PATCH v4 1/9] linux-headers: Update headers to v5.17-rc1

2022-01-24 Thread Vivek Goyal
Update headers to 5.17-rc1. I need latest fuse changes. Signed-off-by: Vivek Goyal --- include/standard-headers/asm-x86/kvm_para.h | 1 + include/standard-headers/drm/drm_fourcc.h | 11 ++ include/standard-headers/linux/ethtool.h | 1 + include/standard-headers/linux/fuse.h

[PATCH v4 3/9] virtiofsd: Parse extended "struct fuse_init_in"

2022-01-24 Thread Vivek Goyal
Add some code to parse extended "struct fuse_init_in". And use a local variable "flag" to represent 64 bit flags. This will make it easier to add more features without having to worry about two 32bit flags (->flags and ->flags2) in "fuse_struct_in". Si

[PATCH v4 7/9] virtiofsd: Create new file with fscreate set

2022-01-24 Thread Vivek Goyal
and guest policies are in sync and don't conflict. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 317 --- 1 file changed, 290 insertions(+), 27 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index

[PATCH v4 5/9] virtiofsd, fuse_lowlevel.c: Add capability to parse security context

2022-01-24 Thread Vivek Goyal
Add capability to enable and parse security context as sent by client and put into fuse_req. Filesystems now can get security context from request and set it on files during creation. Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_common.h | 5 ++ tools/virtiofsd/fuse_i.h| 7

[PATCH v4 2/9] virtiofsd: Fix breakage due to fuse_init_in size change

2022-01-24 Thread Vivek Goyal
posted which will parse rest of the bytes and enable new functionality. Right now we don't support any of the new functionality, so we don't lose anything by not parsing bytes beyond 16. Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_lowlevel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-

[PATCH v4 0/9] virtiofsd: Add support for file security context at creation

2022-01-24 Thread Vivek Goyal
. This will send SELinux context at file creation to server and server can set it on file. Please have a look and consider for inclusion. Thanks Vivek Vivek Goyal (9): linux-headers: Update headers to v5.17-rc1 virtiofsd: Fix breakage due to fuse_init_in size change virtiofsd: Parse extended

[PATCH v4 6/9] virtiofsd: Move core file creation code in separate function

2022-01-24 Thread Vivek Goyal
Move core file creation bits in a separate function. Soon this is going to get more complex as file creation need to set security context also. And there will be multiple modes of file creation in next patch. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 36

[PATCH v4 4/9] virtiofsd: Extend size of fuse_conn_info->capable and ->want fields

2022-01-24 Thread Vivek Goyal
fields are not suffcient anymore. Increase size to 64 bit so that we can add newer capabilities and still be able to use existing code to check and set the capabilities. Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_common.h | 4 ++-- tools/virtiofsd/fuse_lowlevel.c | 2 +- 2 files changed, 3 inse

[PATCH v4 8/9] virtiofsd: Create new file using O_TMPFILE and set security context

2022-01-24 Thread Vivek Goyal
e fallback to non-atomic behavior. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 80 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 7a714b1b5e..4505c0c

[PATCH v4 9/9] virtiofsd: Add an option to enable/disable security label

2022-01-24 Thread Vivek Goyal
a SELinux label. File server will set this label on the file. It will try to set it atomically wherever possible. But its not possible in all the cases. Signed-off-by: Vivek Goyal --- docs/tools/virtiofsd.rst | 7 +++ tools/virtiofsd/helper.c | 1 + tools/virtiofsd/passthrough

Re: [Virtio-fs] [PATCH v2] virtiofsd: Do not support blocking flock

2022-01-14 Thread Vivek Goyal
On Thu, Jan 13, 2022 at 04:32:49PM +0100, Sebastian Hasler wrote: > With the current implementation, blocking flock can lead to > deadlock. Thus, it's better to return EOPNOTSUPP if a user attempts > to perform a blocking flock request. > > Signed-off-by: Sebastian Hasler Rev

[PATCH v3 2/6] virtiofsd, fuse_lowlevel.c: Add capability to parse security context

2021-11-10 Thread Vivek Goyal
Add capability to enable and parse security context as sent by client and put into fuse_req. Filesystems now can get security context from request and set it on files during creation. Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_common.h | 5 ++ tools/virtiofsd/fuse_i.h| 7

[PATCH v3 6/6] virtiofsd: Add an option to enable/disable security label

2021-11-10 Thread Vivek Goyal
a SELinux label. File server will set this label on the file. It will try to set it atomically wherever possible. But its not possible in all the cases. Signed-off-by: Vivek Goyal --- docs/tools/virtiofsd.rst | 7 +++ tools/virtiofsd/helper.c | 1 + tools/virtiofsd/passthrough

[PATCH v3 0/6] virtiofsd: Add support for file security context at creation

2021-11-10 Thread Vivek Goyal
://lore.kernel.org/linux-fsdevel/2020225528.48601-1-vgo...@redhat.com/T/#m08352d3d46f948c6c507c28f9db83098d175ca54 Changes since v2: - Renamed "struct fuse_secctxs" to "struct fuse_secctx_header". - Added a size field to fuse_secctx_header. Thanks Vivek Vivek Goyal (6): fuse:

[PATCH v3 1/6] fuse: Header file changes for FUSE_SECURITY_CTX

2021-11-10 Thread Vivek Goyal
These are just header file changes which should show up in qemu if corresponding kernel changes get merged. Signed-off-by: Vivek Goyal --- include/standard-headers/linux/fuse.h | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/standard-headers/linux

[PATCH v3 5/6] virtiofsd: Create new file using O_TMPFILE and set security context

2021-11-10 Thread Vivek Goyal
e fallback to non-atomic behavior. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 80 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 7a714b1b5e..4505c0c

[PATCH v3 3/6] virtiofsd: Move core file creation code in separate function

2021-11-10 Thread Vivek Goyal
Move core file creation bits in a separate function. Soon this is going to get more complex as file creation need to set security context also. And there will be multiple modes of file creation in next patch. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 36

[PATCH v3 4/6] virtiofsd: Create new file with fscreate set

2021-11-10 Thread Vivek Goyal
and guest policies are in sync and don't conflict. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 317 --- 1 file changed, 290 insertions(+), 27 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index

Re: [for-6.1 v3 0/3] virtiofsd: Add support for FUSE_SYNCFS request

2021-11-10 Thread Vivek Goyal
Hi Greg, I don't see FUSE_SYNCFS support in virtiofsd. I see that kernel patches got merged. Did you post another version of patches? Will be nice to add syncfs support in virtiofsd/virtiofsd_rs as well. Thanks Vivek On Mon, May 10, 2021 at 05:55:36PM +0200, Greg Kurz wrote: > FUSE_SYNCFS

Re: [PATCH v4 11/12] virtiofsd: Optionally fill lo_inode.fhandle

2021-10-20 Thread Vivek Goyal
On Wed, Oct 20, 2021 at 12:00:07PM +0200, Hanna Reitz wrote: [..] > > > @@ -1302,13 +1512,26 @@ static int lo_do_lookup(fuse_req_t req, > > > fuse_ino_t parent, const char *name, > > > goto out; > > > } > > > -newfd = openat(dir_path_fd.fd, name, O_PATH | O_NOFOLLOW); > > > -

Re: [PATCH v4 01/12] virtiofsd: Keep /proc/self/mountinfo open

2021-10-20 Thread Vivek Goyal
On Wed, Oct 20, 2021 at 11:04:31AM +0200, Hanna Reitz wrote: > On 18.10.21 19:07, Vivek Goyal wrote: > > On Thu, Sep 16, 2021 at 10:40:34AM +0200, Hanna Reitz wrote: > > > File handles are specific to mounts, and so name_to_handle_at() returns > > > the re

Re: [PATCH v4 10/12] virtiofsd: Add inodes_by_handle hash table

2021-10-20 Thread Vivek Goyal
On Wed, Oct 20, 2021 at 04:10:51PM +0200, Hanna Reitz wrote: > On 20.10.21 14:29, Vivek Goyal wrote: > > On Wed, Oct 20, 2021 at 12:02:32PM +0200, Hanna Reitz wrote: > > > On 19.10.21 22:02, Vivek Goyal wrote: > > > > On Thu, Sep 16, 2021 at 10:40:43AM +0200, Hanna Re

Re: [PATCH v4 10/12] virtiofsd: Add inodes_by_handle hash table

2021-10-20 Thread Vivek Goyal
On Wed, Oct 20, 2021 at 12:02:32PM +0200, Hanna Reitz wrote: > On 19.10.21 22:02, Vivek Goyal wrote: > > On Thu, Sep 16, 2021 at 10:40:43AM +0200, Hanna Reitz wrote: > > > Currently, lo_inode.fhandle is always NULL and so always keep an O_PATH > > > FD in lo

Re: [PATCH v4 10/12] virtiofsd: Add inodes_by_handle hash table

2021-10-20 Thread Vivek Goyal
On Wed, Oct 20, 2021 at 12:02:32PM +0200, Hanna Reitz wrote: > On 19.10.21 22:02, Vivek Goyal wrote: > > On Thu, Sep 16, 2021 at 10:40:43AM +0200, Hanna Reitz wrote: > > > Currently, lo_inode.fhandle is always NULL and so always keep an O_PATH > > > FD in lo

Re: [PATCH v4 10/12] virtiofsd: Add inodes_by_handle hash table

2021-10-19 Thread Vivek Goyal
On Thu, Sep 16, 2021 at 10:40:43AM +0200, Hanna Reitz wrote: > Currently, lo_inode.fhandle is always NULL and so always keep an O_PATH > FD in lo_inode.fd. Therefore, when the respective inode is unlinked, > its inode ID will remain in use until we drop our lo_inode (and > lo_inode_put() thus

Re: [PATCH v4 11/12] virtiofsd: Optionally fill lo_inode.fhandle

2021-10-19 Thread Vivek Goyal
On Thu, Sep 16, 2021 at 10:40:44AM +0200, Hanna Reitz wrote: > When the inode_file_handles option is set, try to generate a file handle > for new inodes instead of opening an O_PATH FD. > > Being able to open these again will require CAP_DAC_READ_SEARCH, so > setting this option will result in us

Re: [PATCH v4 07/12] virtiofsd: Let lo_inode_open() return a TempFd

2021-10-18 Thread Vivek Goyal
On Thu, Sep 16, 2021 at 10:40:40AM +0200, Hanna Reitz wrote: > Strictly speaking, this is not necessary, because lo_inode_open() will > always return a new FD owned by the caller, so TempFd.owned will always > be true. > > The auto-cleanup is nice, though. Also, we get a more unified interface >

Re: [PATCH v4 00/12] virtiofsd: Allow using file handles instead of O_PATH FDs

2021-10-18 Thread Vivek Goyal
On Thu, Sep 16, 2021 at 10:40:33AM +0200, Hanna Reitz wrote: [..] > Second, I’ve renamed the TempFd objects to reflect what kind of FDs they > contain; i.e. they’re no longer called “inode_fd” or “dir_fd”, but > “path_fd”, “rw_fd”, or “dir_path_fd” instead. This change is really helpful. Makes

Re: [PATCH v4 02/12] virtiofsd: Limit setxattr()'s creds-dropped region

2021-10-18 Thread Vivek Goyal
On Thu, Sep 16, 2021 at 10:40:35AM +0200, Hanna Reitz wrote: > We only need to drop/switch our credentials for the (f)setxattr() call > alone, not for the openat() or fchdir() around it. > > (Right now, this may not be that big of a problem, but with inodes being > identified by file handles

Re: [PATCH v4 01/12] virtiofsd: Keep /proc/self/mountinfo open

2021-10-18 Thread Vivek Goyal
On Thu, Sep 16, 2021 at 10:40:34AM +0200, Hanna Reitz wrote: > File handles are specific to mounts, and so name_to_handle_at() returns > the respective mount ID. However, open_by_handle_at() is not content > with an ID, it wants a file descriptor for some inode on the mount, > which we have to

Re: [Virtio-fs] [PATCH] virtiofsd: Error on bad socket group name

2021-10-18 Thread Vivek Goyal
unable to find group 'zaphod' > > Reported-by: Xiaoling Gao > Signed-off-by: Dr. David Alan Gilbert Hi Dave, This looks good to me. Just a minor nit for code cleanup. It could be done in a separate patch or sometime later as well. Reviewed-by: Vivek Goyal > --- > tools/virtiofsd/fus

[PATCH v2 6/6] virtiofsd: Add an option to enable/disable security label

2021-10-14 Thread Vivek Goyal
a SELinux label. File server will set this label on the file. It will try to set it atomically wherever possible. But its not possible in all the cases. Signed-off-by: Vivek Goyal --- docs/tools/virtiofsd.rst | 7 +++ tools/virtiofsd/helper.c | 1 + tools/virtiofsd/passthrough

[PATCH v2 5/6] virtiofsd: Create new file using O_TMPFILE and set security context

2021-10-14 Thread Vivek Goyal
e fallback to non-atomic behavior. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 80 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 7a714b1b5e..4505c0c

[PATCH v2 3/6] virtiofsd: Move core file creation code in separate function

2021-10-14 Thread Vivek Goyal
Move core file creation bits in a separate function. Soon this is going to get more complex as file creation need to set security context also. And there will be multiple modes of file creation in next patch. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 36

[PATCH v2 1/6] fuse: Header file changes for FUSE_SECURITY_CTX

2021-10-14 Thread Vivek Goyal
These are just header file changes which should show up in qemu if corresponding kernel changes get merged. Signed-off-by: Vivek Goyal --- include/standard-headers/linux/fuse.h | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/standard-headers/linux

[PATCH v2 4/6] virtiofsd: Create new file with fscreate set

2021-10-14 Thread Vivek Goyal
and guest policies are in sync and don't conflict. Signed-off-by: Vivek Goyal --- tools/virtiofsd/passthrough_ll.c | 317 --- 1 file changed, 290 insertions(+), 27 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index

[PATCH v2 2/6] virtiofsd, fuse_lowlevel.c: Add capability to parse security context

2021-10-14 Thread Vivek Goyal
Add capability to enable and parse security context as sent by client and put into fuse_req. Filesystems now can get security context from request and set it on files during creation. Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_common.h | 5 ++ tools/virtiofsd/fuse_i.h| 7

  1   2   3   4   5   >