Re: [Virtio-fs] [PATCH] virtiofs: Export filesystem tags through sysfs

2023-10-09 Thread Vivek Goyal
On Mon, Oct 09, 2023 at 11:53:42AM +0200, Miklos Szeredi wrote: > On Thu, 5 Oct 2023 at 22:30, Vivek Goyal wrote: > > > > virtiofs filesystem is mounted using a "tag" which is exported by the > > virtiofs device. virtiofs driver knows about all the available tags

[Virtio-fs] [PATCH] virtiofs: Export filesystem tags through sysfs

2023-10-05 Thread Vivek Goyal
l filesystem tag can be obtained by reading this "tag" file. For example, if a virtiofs device exports tag "myfs", a new file "tag" will show up here. /sys/bus/virtio/devices/virtio/tag # cat /sys/bus/virtio/devices/virtio/tag myfs Signed-

Re: [Virtio-fs] 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: [Virtio-fs] 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: [Virtio-fs] 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: [Virtio-fs] 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: [Virtio-fs] 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

[Virtio-fs] [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: [Virtio-fs] 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: [Virtio-fs] 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] Ownership of a file shared between guest and host

2022-07-12 Thread Vivek Goyal
On Fri, Jul 08, 2022 at 08:18:19PM +, Pra.. Dew.. wrote: > We have been able to setup virtiofs between guest and host (QEMU 6.2/Linux > 5.15). We run virtiofsd as a non-root user in the host. We did not want to > run it as a root user in order to minimize the attack surface. We run it as a

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: [Virtio-fs] vhost_set_vring_kick failed

2022-05-31 Thread Vivek Goyal
c very well. So I will defer it to Sergio if something can be done to support older qemu. Thanks Vivek > ________ > From: Vivek Goyal > Sent: Monday, May 30, 2022 10:11 PM > To: Sergio Lopez ; Prashant Dewan > Cc: Stefan Hajnoczi ; virtio-fs@redhat.com

Re: [Virtio-fs] vhost_set_vring_kick failed

2022-05-30 Thread Vivek Goyal
On Thu, May 26, 2022 at 10:06:46AM +0200, Sergio Lopez wrote: > On Thu, May 26, 2022 at 08:49:34AM +0100, Stefan Hajnoczi wrote: > > On Thu, May 26, 2022 at 05:34:42AM +, Prashant Dewan wrote: > > > Hello Stefan, > > > > > > Here is the output from virtofsd.. > > > > > >

Re: [Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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: >

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

2022-02-08 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: [Virtio-fs] [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-08 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: [Virtio-fs] [PATCH v5 9/9] virtiofsd: Add an option to enable/disable security label

2022-02-08 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: [Virtio-fs] [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-08 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: [Virtio-fs] [PATCH v5 7/9] virtiofsd: Create new file with fscreate set

2022-02-08 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: [Virtio-fs] [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-08 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: [Virtio-fs] [PATCH v5 5/9] virtiofsd, fuse_lowlevel.c: Add capability to parse security context

2022-02-08 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: [Virtio-fs] [PATCH v5 3/9] virtiofsd: Parse extended "struct fuse_init_in"

2022-02-08 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

[Virtio-fs] [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

[Virtio-fs] [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_

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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 |

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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"

[Virtio-fs] [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

[Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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: [Virtio-fs] [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

[Virtio-fs] [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(

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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

[Virtio-fs] [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(-

[Virtio-fs] [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

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

Re: [Virtio-fs] Announcing the release of virtiofsd (Rust) v1.0.0

2021-12-23 Thread Vivek Goyal
On Thu, Dec 23, 2021 at 12:22:19PM +0100, Sergio Lopez wrote: > Hi, > > On behalf of the Virtiofs Maintainers Team, it's my pleasure to > announce the release of virtiofsd v1.0.0, the first stable release of > the Rust implementation of the vhost-user virtiofs daemon. > > This version is

Re: [Virtio-fs] [RFC PATCH 0/7] Inotify support in FUSE and virtiofs

2021-12-20 Thread Vivek Goyal
On Sat, Dec 18, 2021 at 10:28:35AM +0200, Amir Goldstein wrote: > > > > > > > > > 2. For FS_RENAME, will we be able to pass 4 buffers in iov? > > > > > src_fuse_notify_fsnotify_out, src_name, > > > > > dst_fuse_notify_fsnotify_out, dst_name > > > > > > > > So it is sort of two fsnotify

Re: [Virtio-fs] [RFC PATCH 0/7] Inotify support in FUSE and virtiofs

2021-12-17 Thread Vivek Goyal
On Fri, Dec 17, 2021 at 06:21:28AM +0200, Amir Goldstein wrote: > > Ok, lets spend some time on figuring out how the fsnotify_out struct > > should look like to meet the needs of fanotify as well. > > > > > > > > I thought you passed the name as buffer in iov array. > > > Or maybe that's not how

Re: [Virtio-fs] [RFC PATCH 0/7] Inotify support in FUSE and virtiofs

2021-12-16 Thread Vivek Goyal
On Thu, Dec 16, 2021 at 08:22:19PM +0200, Amir Goldstein wrote: [..] > > So how much information we need to carry which covers all the existing > > events. So for the case of rename, looks > > > > For the case of rename, it sounds like we will need to report > > "node ids" of two directories and

Re: [Virtio-fs] [RFC PATCH 0/7] Inotify support in FUSE and virtiofs

2021-12-16 Thread Vivek Goyal
On Thu, Dec 16, 2021 at 01:03:00PM +0200, Amir Goldstein wrote: > > > I understand that part. But at the same time, remote fsnotify API will > > > probably evolve as you keep on adding more functionality. What if there > > > is another notification mechanism tomorrow say newfancynotify(), we > > >

Re: [Virtio-fs] [RFC PATCH 0/7] Inotify support in FUSE and virtiofs

2021-12-15 Thread Vivek Goyal
On Wed, Dec 15, 2021 at 09:10:47AM +0200, Amir Goldstein wrote: > On Wed, Dec 15, 2021 at 1:22 AM Ioannis Angelakopoulos > wrote: > > > > Hello Amir and Jan, > > > > After testing some of your proposals, related to extending the remote > > notification to fanotify as well, we came across some

Re: [Virtio-fs] [PATCH v8 0/7] fuse,virtiofs: support per-file DAX

2021-12-13 Thread Vivek Goyal
On Thu, Nov 25, 2021 at 03:05:23PM +0800, Jeffle Xu wrote: > changes since v7: > - rebase to v5.16 > - patch 2: rename FUSE_DAX_NONE|FUSE_DAX_INODE to > FUSE_DAX_INODE_DEFAULT|FUSE_DAX_INODE_USER > - patch 5: remove redundant call for fuse_is_inode_dax_mode() in > process_init_reply() > -

Re: [Virtio-fs] [PATCH v8 2/7] fuse: make DAX mount option a tri-state

2021-12-13 Thread Vivek Goyal
pport that. > > Also noted that by the time of this commit, 'inode' mode is actually > equal to 'always' mode, before the per inode DAX flag is introduced in > the following patch. > > Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Vivek > --- > fs/fuse/dax.c

Re: [Virtio-fs] [PATCH v8 4/7] fuse: enable per inode DAX

2021-12-13 Thread Vivek Goyal
t; > The FUSE_ATTR_DAX flag in FUSE_LOOKUP reply is used to indicate whether > DAX should be enabled or not for corresponding file. Currently the state > whether DAX is enabled or not for the file is initialized only when > inode is instantiated. > > Signed-off-by:

Re: [Virtio-fs] [PATCH v8 6/7] fuse: mark inode DONT_CACHE when per inode DAX hint changes

2021-12-13 Thread Vivek Goyal
tate. > > In summary, when the per inode DAX hint changes for an *opened* file, the > DAX state of the file won't be updated until this file is closed and > reopened later. > > Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Vivek > --- > fs/fuse/dax.c| 9

Re: [Virtio-fs] [PATCH v8 3/7] fuse: support per inode DAX in fuse protocol

2021-12-13 Thread Vivek Goyal
t; FUSE_ATTR_DAX flag is added indicating if DAX shall be enabled for > corresponding file. It is conveyed in FUSE_LOOKUP reply. > > Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Vivek > --- > include/uapi/linux/fuse.h | 5 + > 1 file changed, 5 insertions(+) > > dif

Re: [Virtio-fs] [PATCH v8 5/7] fuse: negotiate per inode DAX in FUSE_INIT

2021-12-13 Thread Vivek Goyal
. > > Server shall also advertise support for per inode DAX. If server doesn't > support it while client is mounted with "dax=inode", client will > silently fallback to "dax=never" since "dax=inode" is advisory only. > > Signed-off-by: Jeffle Xu Revie

Re: [Virtio-fs] [PATCH v8 7/7] Documentation/filesystem/dax: DAX on virtiofs

2021-12-13 Thread Vivek Goyal
On Thu, Nov 25, 2021 at 03:05:30PM +0800, Jeffle Xu wrote: > Record DAX on virtiofs and the semantic difference with that on ext4 > and xfs. > > Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Vivek > --- > Documentation/filesystems/dax.rst | 20 ++-- >

Re: [Virtio-fs] [PATCH v8 1/7] fuse: add fuse_should_enable_dax() helper

2021-12-13 Thread Vivek Goyal
On Thu, Nov 25, 2021 at 03:05:24PM +0800, Jeffle Xu wrote: > This is in prep for following per inode DAX checking. > > Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Vivek > --- > fs/fuse/dax.c | 10 +- > 1 file changed, 9 insertions(+), 1 deletion(-) > &

Re: [Virtio-fs] [PATCH v7 0/6] virtiofsd: support per inode DAX

2021-12-13 Thread Vivek Goyal
is not a strict requirement to merge kernel patches. I will provide my ack for the kernel patches. After that it is up to the Miklos to accept or reject those patches. Thanks Vivek > > > On 12/9/21 4:05 AM, Vivek Goyal wrote: > > On Wed, Dec 08, 2021 at 09:38:45AM +0800, JeffleXu wrote: &

Re: [Virtio-fs] [PATCH v7 1/6] virtiofsd: add .ioctl() support

2021-12-13 Thread Vivek Goyal
On Fri, Dec 10, 2021 at 10:51:45AM +0800, JeffleXu wrote: > > > On 12/10/21 3:33 AM, Vivek Goyal wrote: > > On Tue, Nov 02, 2021 at 01:56:41PM +0800, Jeffle Xu wrote: > >> For passthrough, it passes corresponding ioctls to host directly. > >> > >>

Re: [Virtio-fs] [PATCH v7 5/6] virtiofsd: implement xflag based dax policy

2021-12-09 Thread Vivek Goyal
On Tue, Nov 02, 2021 at 01:56:45PM +0800, Jeffle Xu wrote: > The per inode DAX feature in ext4/xfs uses the persistent inode flag, > i.e. FS_DAX_FL/FS_XFLAG_DAX, to indicate if DAX shall be enabled for > this file or not when filesystem is mounted in per inode DAX mode. > > To keep compatible

Re: [Virtio-fs] [PATCH v7 6/6] virtiofsd: implement file size based dax policy

2021-12-09 Thread Vivek Goyal
On Tue, Nov 02, 2021 at 01:56:46PM +0800, Jeffle Xu wrote: > When DAX window is fully utilized and needs to be expanded to avoid the > performance fluctuation triggered by DAX window recaliming, it may not > be wise to allocate DAX window for files with size smaller than some > specific point,

Re: [Virtio-fs] [PATCH v7 5/6] virtiofsd: implement xflag based dax policy

2021-12-09 Thread Vivek Goyal
On Tue, Nov 02, 2021 at 01:56:45PM +0800, Jeffle Xu wrote: > The per inode DAX feature in ext4/xfs uses the persistent inode flag, > i.e. FS_DAX_FL/FS_XFLAG_DAX, to indicate if DAX shall be enabled for > this file or not when filesystem is mounted in per inode DAX mode. > > To keep compatible

Re: [Virtio-fs] [PATCH v7 3/6] virtiofsd: add 'dax=' option

2021-12-09 Thread Vivek Goyal
On Tue, Nov 02, 2021 at 01:56:43PM +0800, Jeffle Xu wrote: > This option is used to specify the policy of constructing per-inode DAX > attribute when guest virtiofs is mounted with "-o dax=inode". > > Currently there are two valid policies, "inode" and "filesize". General thoughts. I think

Re: [Virtio-fs] [PATCH v7 1/6] virtiofsd: add .ioctl() support

2021-12-09 Thread Vivek Goyal
On Tue, Nov 02, 2021 at 01:56:41PM +0800, Jeffle Xu wrote: > For passthrough, it passes corresponding ioctls to host directly. > > Currently only these ioctls that handling persistent inode flags, i.e., > FS_IOC_[G|S]ETFLAGS and FS_IOC_FS[G|S]ETXATTR are supported for security > concern, though

Re: [Virtio-fs] [PATCH v7 0/6] virtiofsd: support per inode DAX

2021-12-08 Thread Vivek Goyal
On Wed, Dec 08, 2021 at 09:38:45AM +0800, JeffleXu wrote: > > > On 12/7/21 10:42 PM, Vivek Goyal wrote: > > Hi Jeffle, > > > > I noticed that you posted V8 of kernel patches. I was away from work > > so could not look at it. Now I am back and want to

Re: [Virtio-fs] [PATCH v8 6/7] fuse: mark inode DONT_CACHE when per inode DAX hint changes

2021-12-07 Thread Vivek Goyal
On Thu, Nov 25, 2021 at 03:05:29PM +0800, Jeffle Xu wrote: > When the per inode DAX hint changes while the file is still *opened*, it > is quite complicated and maybe fragile to dynamically change the DAX > state. > > Hence mark the inode and corresponding dentries as DONE_CACHE once the > per

  1   2   3   4   5   6   7   8   9   10   >