Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3463031imm; Fri, 19 Oct 2018 10:59:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV60pSdBQ9/K0rziBvLqraXej2lIZE5KV+JPfGA3pZOmWek2mzZ/IdCiW00hmA4qA64cXlL6c X-Received: by 2002:a17:902:76c3:: with SMTP id j3-v6mr35441230plt.339.1539971997530; Fri, 19 Oct 2018 10:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539971997; cv=none; d=google.com; s=arc-20160816; b=Oyml8Z2wDVIIFuV9GeeCm6rJ6BtIda5XJJDfgEK9etBtWfSorrhYXzANFuvSHslH2M I+Z50b6LPVSF0aH20PbzeCx96GMEvMPkglJj/WtuTaJkiYmzlk7X5LwTxL5bBTdtqt0U fbHmKGo6SRUwpnoxAHxJdMkaEj+It1nKtLtsF5jF0cRRflK1Wg7SLLu7H7BEnB2A1MAO gbNgFiltxUaOpio1/w81m3/3AEMC5sqsKXUrfjE14zo8yuMy/C0r83sXuSX+vHsD+bh8 1oe3fJUy4gSBTSE0fn2qkIwEUuz+Ex2wgbAr+g+ek/s7q1j0nZi5qzzdISVje/+EHY6L t/JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=URFdpKmR7MBDOg1F2ktj6/bvR16V6cHwaXYS8cjdJ9g=; b=LcjNYl/17XokB0qUEZ5mzow+E6NCtfWwQxkgH4YhVqqk88PRSb2KBizVztGG8VEVpt UTHyV+an6xTkehuIF7GxihwhNhh14gm06KGmNNPZLb7PKd9nUjrh6SsRn75Y3rMd7mfq zxx/B5sfQ4+nOBKvpDg2b0v2F0e3Z4VfmXRBQvHb8LGim6b56HkK6qEIyaRtwoWeIJlq B16AOPPrGIe3inQXGk8Z26Atlthti1jH1icJoTNrfJoAc/x6PSPcufExvaXJLVMUuNa9 X4Z0AxfQYqQlPEk7llgCR+7v9/r9b6Dxv9PcPhRrIvqX1Ff7gBcP5xPnwl0PBOLhnueD SboA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=tcZHWPlk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o65-v6si25783799pfg.266.2018.10.19.10.59.42; Fri, 19 Oct 2018 10:59:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=tcZHWPlk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727872AbeJTCEm (ORCPT + 99 others); Fri, 19 Oct 2018 22:04:42 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:44547 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727738AbeJTCEm (ORCPT ); Fri, 19 Oct 2018 22:04:42 -0400 Received: by mail-lf1-f65.google.com with SMTP id m18-v6so25886620lfl.11 for ; Fri, 19 Oct 2018 10:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=URFdpKmR7MBDOg1F2ktj6/bvR16V6cHwaXYS8cjdJ9g=; b=tcZHWPlkmY2dWEEGj+fNVwRLJfThsAX1mwdfqLbUe6a9ToC15YXoM6sUgQGXNlDeDC SlaSQJEP+uqWMlWdmxHrNe11H9u+KLDHfyLCnvzMA1bYcV7Er4cyuOFvTMkvJMC+E7c7 nqHets4YqJExT56C4z2BbluR5uJdpDfJ8xxrg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=URFdpKmR7MBDOg1F2ktj6/bvR16V6cHwaXYS8cjdJ9g=; b=Wrx5Lv2fbfexFes2ORRyy8peEM2Kr3AJ/zbA1kR35ZBV2mbDUX6+kIRSOXqiCNfeq7 +v6Qw9cCo6U9vs6jlv4UALDo2TG3gKCOTxeY4Tkris7W6X5hcqetNn0ZwgG2GvGx4ZkA rf2F4RIJzMLZ1u0yUcc8nKFao94HCziL7dfCLigrqG8Cq43r4uuf7p1eHSAqw+g0bjII Wd0HjiIw+nzlkqUUn/1MdE0msDQCHKKD4kxla/GLmS0YZ3tkUIe5tuYWfg95RHE7CLJ4 BkyFvFAHTKmqP6pVgvwET4Br0RU5SF8RBc5gWdz8Tx8X5tBacfb5cqE2gDimB46o6zjQ Woog== X-Gm-Message-State: ABuFfoisd8WgIYyF+sYOTcgV4Jm766XvfYIDRNBWriCVOhdlmds6NTzS o0uJ1noCeF7wif+3kWbmE2Xa3uDqSEExnY06C0R/6Q== X-Received: by 2002:a19:639b:: with SMTP id v27mr2759168lfi.95.1539971852486; Fri, 19 Oct 2018 10:57:32 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:8e91:0:0:0:0:0 with HTTP; Fri, 19 Oct 2018 10:57:31 -0700 (PDT) In-Reply-To: <42922.1539970322@turing-police.cc.vt.edu> References: <20181018065908.254389-1-joel@joelfernandes.org> <42922.1539970322@turing-police.cc.vt.edu> From: Joel Fernandes Date: Fri, 19 Oct 2018 10:57:31 -0700 Message-ID: Subject: Re: [PATCH v3 1/2] mm: Add an F_SEAL_FUTURE_WRITE seal to memfd To: valdis.kletnieks@vt.edu 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 19, 2018 at 10:32 AM, wrote: > On Wed, 17 Oct 2018 23:59:07 -0700, "Joel Fernandes (Google)" said: >> This usecase cannot be implemented with the existing F_SEAL_WRITE seal. >> To support the usecase, this patch adds a new F_SEAL_FUTURE_WRITE seal >> which prevents any future mmap and write syscalls from succeeding while >> keeping the existing mmap active. The following program shows the seal >> working in action: > > 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. 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. I could test that processor stores can continue to happen my doing a memset into the existing map, but I feel that is like testing 2+2 = 4, in a way ;-) Do you really think its worth testing? If you do, then I could add a test for that. - Joel