Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4593169pxt; Wed, 11 Aug 2021 09:23:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn0muE8uGgb+t/kJAvqutgkINHAQBwUT+cDaiHrCE4Pk5tjCv0mMm9HtIs6Ic+BULet0lH X-Received: by 2002:a05:6402:3489:: with SMTP id v9mr12495883edc.379.1628698994889; Wed, 11 Aug 2021 09:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628698994; cv=none; d=google.com; s=arc-20160816; b=laBGTQvPewNkD5Jq+ssQc2Zk60cCJbEzA2u+zuY62r/OfbXUkAxnPh9p5iDivi3bJ7 i+8q9eBv2r8AWafsJ6r7mL5rEQh+jjWsVCzzl+AelJgwGtrY/bX1WgCpCq93e/sFygNe dNCIZ2ClADMTrDyFEhfDzpLYDVDV1jCph8MWHP8usUMpoZ4WxcX2EatmaxNw8ILVLRiw mqzqipbBkJtGGtqqbp574Q35csXWDXkQGCkMXXM1q9AaC4ihBe1f38qLBmnKEfhD4/wi qYalFjjPKBDIvJ8QQeV/N0tGfOzD5NxVhPEpEN6aN9qVvO9qvLJjVY3GLy7v54vybi5n PbYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TP3ufg1FSgd52Z8zyecJ3z2FJfxxpEJLtGauUCReCG0=; b=Grqo5emmMqfoTMY/DPdLKqs+xif7JvWUgH+U0Vwk2/NL36REHUbXLuI2aHu2vSW84l X0h/eOf3rBQOSJ1ZNg9wjhJ7HC+cL1jg5ytu7WKcIgjFWJDc5EmQDH/UOUbkwrKOoMi8 lgpMOBQVxJe8+Qyf80jKUnnhdqrbjpvB7j8xskzEWUV2crYzmFmQqO/HCKqiim0lH53N oPDauWcGPIlvo2Utt4shyt5MlQcFv+Db6+iGpIzL+NHDgZJ4Kg3noTEogr85gf8NTSwE F69yx1+vdRBMf49gkYLlhjbTEWbrmnYt2xQBuZ29QGe5edq63tIQOfMiCm7y7dg3gTcF WYrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=EA116gbT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si23572883ejy.113.2021.08.11.09.22.49; Wed, 11 Aug 2021 09:23:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=EA116gbT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbhHKQVE (ORCPT + 99 others); Wed, 11 Aug 2021 12:21:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbhHKQVE (ORCPT ); Wed, 11 Aug 2021 12:21:04 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 382ACC061765 for ; Wed, 11 Aug 2021 09:20:40 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id w1so6711838lfq.10 for ; Wed, 11 Aug 2021 09:20:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TP3ufg1FSgd52Z8zyecJ3z2FJfxxpEJLtGauUCReCG0=; b=EA116gbTFYV7o499N6EJRHWJpCb8E2cDR0KgG9vT5t8Ki0uDt41w7TZRef7nzLjAUy UxWG1a3ITXp/zwWJES+A2QmPSrpf6qK3SJgg3e2aC00nDoCc1sPpGjZf8HpjD4pZnot3 ERmXXUn8oCwiDwA5toJaM50lGWo9uwncEZGX0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TP3ufg1FSgd52Z8zyecJ3z2FJfxxpEJLtGauUCReCG0=; b=QwXnWixBeTmiv+DeM347gQNc4vdpcoMQgh31XkiP41Ts3inhyiNF2nqLfjplp/UpPj P4CPKOpAqUIimSrzagqLavwR56Y0Kis1Bwl7/KGFcabSyyBnESXe6HDJWd+Y1lVUGygQ WZm+Odn28I4LnIM/S5J/8DWlEvsXCJphaQzDi70il1ot7p2EEuerfCe9u09tDp3USsE0 pEJBFWOkgFTnpeEL+jsJxbKWoOPGI/N4BCRUhk0A6Df6IclzD0VqWVO/k26hHdjMPk7y 8KxwsrXVfUJojjMCgr191tHkRM9Nx9+sjvTIKg8WXRGvNd5TFabRzNTn/chgoQBAaaNv lklA== X-Gm-Message-State: AOAM5326uazhCvApvAkN2PMl1koiLpVQVqkAYuF5i/KYfRVweOdcI8K1 RW5IzTeQMjrEDsY7oDng2QID4Q3Ni2JK1zU9M0w= X-Received: by 2002:a05:6512:3b0f:: with SMTP id f15mr27748809lfv.187.1628698838236; Wed, 11 Aug 2021 09:20:38 -0700 (PDT) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id u18sm739276lfo.280.2021.08.11.09.20.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Aug 2021 09:20:37 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id t9so6915454lfc.6 for ; Wed, 11 Aug 2021 09:20:37 -0700 (PDT) X-Received: by 2002:a19:491b:: with SMTP id w27mr11814406lfa.421.1628698837270; Wed, 11 Aug 2021 09:20:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Wed, 11 Aug 2021 06:20:21 -1000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: mmap denywrite mess (Was: [GIT PULL] overlayfs fixes for 5.14-rc6) To: David Hildenbrand Cc: Miklos Szeredi , =?UTF-8?Q?Christian_K=C3=B6nig?= , Matthew Wilcox , linux-mm , Linux Kernel Mailing List , linux-fsdevel , linux-unionfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 11, 2021 at 4:45 AM David Hildenbrand wrote: > > I proposed a while ago to get rid of VM_DENYWRITE completely: > > https://lkml.kernel.org/r/20210423131640.20080-1-david@redhat.com > > I haven't looked how much it still applies to current upstream, but > maybe that might help cleaning up that code. I like it. I agree that we could - and probably should - just do it this way. We don't expose MAP_DENYWRITE to user space any more - and the old legacy library loading code certainly isn't worth it - and so effectively the only way to set it is with execve(). And yes, it gets rid of all the silly games with the per-mapping flags. Linus