From: Jan Kara <jack@suse.cz>
To: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Matthew Wilcox <willy@infradead.org>,
Mike Kravetz <mike.kravetz@oracle.com>,
Muchun Song <muchun.song@linux.dev>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
Andy Lutomirski <luto@amacapital.net>
Subject: Re: [RFC PATCH 0/3] permit write-sealed memfd read-only shared mappings
Date: Fri, 21 Apr 2023 11:01:26 +0200 [thread overview]
Message-ID: <20230421090126.tmem27kfqamkdaxo@quack3> (raw)
In-Reply-To: <cover.1680560277.git.lstoakes@gmail.com>
Hi!
On Mon 03-04-23 23:28:29, Lorenzo Stoakes wrote:
> This patch series is in two parts:-
>
> 1. Currently there are a number of places in the kernel where we assume
> VM_SHARED implies that a mapping is writable. Let's be slightly less
> strict and relax this restriction in the case that VM_MAYWRITE is not
> set.
>
> This should have no noticeable impact as the lack of VM_MAYWRITE implies
> that the mapping can not be made writable via mprotect() or any other
> means.
>
> 2. Align the behaviour of F_SEAL_WRITE and F_SEAL_FUTURE_WRITE on mmap().
> The latter already clears the VM_MAYWRITE flag for a sealed read-only
> mapping, we simply extend this to F_SEAL_WRITE too.
>
> For this to have effect, we must also invoke call_mmap() before
> mapping_map_writable().
>
> As this is quite a fundamental change on the assumptions around VM_SHARED
> and since this causes a visible change to userland (in permitting read-only
> shared mappings on F_SEAL_WRITE mappings), I am putting forward as an RFC
> to see if there is anything terribly wrong with it.
So what I miss in this series is what the motivation is. Is it that you need
to map F_SEAL_WRITE read-only? Why?
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2023-04-21 9:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 22:28 [RFC PATCH 0/3] permit write-sealed memfd read-only shared mappings Lorenzo Stoakes
2023-04-03 22:28 ` [RFC PATCH 1/3] mm: drop the assumption that VM_SHARED always implies writable Lorenzo Stoakes
2023-04-03 22:28 ` [RFC PATCH 2/3] mm: update seal_check_[future_]write() to include F_SEAL_WRITE as well Lorenzo Stoakes
2023-04-03 22:28 ` [RFC PATCH 3/3] mm: perform the mapping_map_writable() check after call_mmap() Lorenzo Stoakes
2023-04-21 9:06 ` Jan Kara
2023-04-21 21:15 ` Lorenzo Stoakes
2023-04-21 9:01 ` Jan Kara [this message]
2023-04-21 21:23 ` [RFC PATCH 0/3] permit write-sealed memfd read-only shared mappings Lorenzo Stoakes
2023-04-24 12:19 ` Jan Kara
2023-04-24 12:23 ` Lorenzo Stoakes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230421090126.tmem27kfqamkdaxo@quack3 \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lstoakes@gmail.com \
--cc=luto@amacapital.net \
--cc=mike.kravetz@oracle.com \
--cc=muchun.song@linux.dev \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).