Re: [PATCH v2 1/2] mm: Add an F_SEAL_FS_WRITE seal to memfd

2018-10-17 Thread Joel Fernandes
On Wed, Oct 17, 2018 at 05:08:29AM -0700, Christoph Hellwig wrote: > On Wed, Oct 17, 2018 at 03:39:58AM -0700, Joel Fernandes wrote: > > > > This usecase cannot be implemented with the existing F_SEAL_WRITE seal. > > > > To support the usecase, this patch adds a new F_SEAL_FS_WRITE seal which > > >

Re: [PATCH v2 1/2] mm: Add an F_SEAL_FS_WRITE seal to memfd

2018-10-17 Thread Christoph Hellwig
On Wed, Oct 17, 2018 at 08:44:01AM -0700, Daniel Colascione wrote: > > Even if no one changes these specific flags we still need a lock due > > to rmw cycles on the field. For example fadvise can set or clear > > FMODE_RANDOM. It seems to use file->f_lock for synchronization. > > Compare-and-exc

Re: [PATCH v2 1/2] mm: Add an F_SEAL_FS_WRITE seal to memfd

2018-10-17 Thread Daniel Colascione
On Wed, Oct 17, 2018 at 5:08 AM, Christoph Hellwig wrote: > On Wed, Oct 17, 2018 at 03:39:58AM -0700, Joel Fernandes wrote: >> > > This usecase cannot be implemented with the existing F_SEAL_WRITE seal. >> > > To support the usecase, this patch adds a new F_SEAL_FS_WRITE seal which >> > > prevents

Re: [PATCH v2 1/2] mm: Add an F_SEAL_FS_WRITE seal to memfd

2018-10-17 Thread Christoph Hellwig
On Wed, Oct 17, 2018 at 03:39:58AM -0700, Joel Fernandes wrote: > > > This usecase cannot be implemented with the existing F_SEAL_WRITE seal. > > > To support the usecase, this patch adds a new F_SEAL_FS_WRITE seal which > > > prevents any future mmap and write syscalls from succeeding while > > >

Re: [PATCH v2 1/2] mm: Add an F_SEAL_FS_WRITE seal to memfd

2018-10-17 Thread Joel Fernandes
On Wed, Oct 17, 2018 at 02:51:55AM -0700, Christoph Hellwig wrote: > On Tue, Oct 09, 2018 at 03:20:41PM -0700, Joel Fernandes (Google) wrote: > > One of the main usecases Android has is the ability to create a region > > and mmap it as writeable, then drop its protection for "future" writes > > whi

Re: [PATCH v2 1/2] mm: Add an F_SEAL_FS_WRITE seal to memfd

2018-10-17 Thread Christoph Hellwig
On Tue, Oct 09, 2018 at 03:20:41PM -0700, Joel Fernandes (Google) wrote: > One of the main usecases Android has is the ability to create a region > and mmap it as writeable, then drop its protection for "future" writes > while keeping the existing already mmap'ed writeable-region active. s/drop/ad

Re: [PATCH v2 1/2] mm: Add an F_SEAL_FS_WRITE seal to memfd

2018-10-16 Thread John Stultz
On Tue, Oct 9, 2018 at 3:20 PM, Joel Fernandes (Google) wrote: > Android uses ashmem for sharing memory regions. We are looking forward > to migrating all usecases of ashmem to memfd so that we can possibly > remove the ashmem driver in the future from staging while also > benefiting from using me

[PATCH v2 1/2] mm: Add an F_SEAL_FS_WRITE seal to memfd

2018-10-09 Thread Joel Fernandes (Google)
Android uses ashmem for sharing memory regions. We are looking forward to migrating all usecases of ashmem to memfd so that we can possibly remove the ashmem driver in the future from staging while also benefiting from using memfd and contributing to it. Note staging drivers are also not ABI and ge