Return-Path: From: valdis.kletnieks@vt.edu To: Joel Fernandes Cc: LKML , kernel-team , John Reck , John Stultz , Todd Kjos , Greg Kroah-Hartman , Christoph Hellwig , Al Viro , Andrew Morton , Daniel Colascione , "J. Bruce Fields" , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-kselftest , linux-mm , marcandre.lureau@redhat.com, Mike Kravetz , Minchan Kim , Shuah Khan , Thomas Gleixner Subject: Re: [PATCH v3 1/2] mm: Add an F_SEAL_FUTURE_WRITE seal to memfd In-Reply-To: References: <20181018065908.254389-1-joel@joelfernandes.org> <42922.1539970322@turing-police.cc.vt.edu> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_1539974951_3102P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Fri, 19 Oct 2018 14:49:11 -0400 Message-ID: <118792.1539974951@turing-police.cc.vt.edu> Sender: owner-linux-mm@kvack.org List-ID: --==_Exmh_1539974951_3102P Content-Type: text/plain; charset=us-ascii On Fri, 19 Oct 2018 10:57:31 -0700, Joel Fernandes said: > On Fri, Oct 19, 2018 at 10:32 AM, wrote: > > What is supposed to happen if some other process has an already existing R/W > > mmap of the region? (For that matter, the test program doesn't seem to > > actually test that the existing mmap region remains writable?) > Why would it not remain writable? We don't change anything in the > mapping that prevents it from being writable, in the patch. OK, if the meaning here is "if another process races and gets its own R/W mmap before we seal our mmap, it's OK". Seems like somewhat shaky security-wise - a possibly malicious process can fail to get a R/W map because we just sealed it, but if it had done the attempt a few milliseconds earlier it would have its own R/W mmap to do as it pleases... On the other hand, decades of trying have proven that trying to do any sort of revoke() is a lot harder to do than it looks... > We do test that existing writable mmaps can continue to exist after > the seal is set, in a way, because we test that setting of the seal > succeeds. Well, if the semantics are "We don't bother trying to deal with existing R/W maps", then it doesn't really matter - I was thinking along the lines of "If we're revoking other R/W accesses, we should test that we didn't nuke *this* one in the bargain".... --==_Exmh_1539974951_3102P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.8.0 04/21/2017 iQEVAwUBW8onJ40DS38y7CIcAQK8gAgAn0hFoG/7NzVOy5Rst3e/VtBaNha/e3V0 N+mOczsxE3dMEijB1Uyu9c9Lzla9XW612XLu/DIgfET40+gYywBE39PQQovZomc3 QEc1GfcRkVUQqncDVvKSAN9JQ7QdWLTvqAva+ChFl8+yAn2Y7hCqg+WHKT7XMqVZ IQl7IZxHgfik1Id2h5IizZgSeBS91WoYehfIrgH59TcFA+Fjek8beOJpBvC4es3m jDyp2LTlACh55TkUM3N7pQtKsNGSMUSekMG+ylFykgY76LS+K1rS9KBpABMFZL0Y +McJX3of+FHEVoJy2W42G6+SRr82+4pVysAeVa8XxGRvS/wvMgTySQ== =GvDD -----END PGP SIGNATURE----- --==_Exmh_1539974951_3102P--