Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp46ybl; Tue, 20 Aug 2019 14:28:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqP16eb3k0LiKsbrxjRNPBMSJwVfR8y7b0KQ9fGh+eD45pwei/n/nCpLFYEv9dH5GsqjhG X-Received: by 2002:a17:902:bcc2:: with SMTP id o2mr30503146pls.127.1566336484464; Tue, 20 Aug 2019 14:28:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566336484; cv=none; d=google.com; s=arc-20160816; b=PJ+9wjJrRNI3Ql1VtrOC1klFbK9CY4HT3h8oF/54Nvs7o8CocjZtFpwcZ9kgWVhcRd ApnwQk3vvIckxGncHRFzO8cBZAA9XJEod2q7+Y+qomRo6HJ7asJ+Y+ywuolVPShYtp08 Oq5Of3hDtXIXQbKKADIw8Xe2Fi+Fqj0xeItJdNQ/CG/ril3vkqy+/TyRQ2oYv+YaWvct Yc5hn1WiirAVpP7HuTUhAoxw3pIAT4f5X4wNeHAthSrLVK9YbRdLbGiq12tmIIQTJVpR NdlrR7oDxSkYenpG2HVQn2gLmGk3sVJ/w+hZYSdbeqeZawWIUgBQj/y5OqGApYG6mh7L /49Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date; bh=dFseITPyXJroB0pSXQgzOu4l/rkBnD/EP1bmMroIq9g=; b=grovWdn/+kWVYDkLW3AF5O3IC0Rii4BoNMgpVh2cl4epanbiEIL+ukV7rQSDLkOv54 g49bDvv/CtDXuDDGbK0n9evyThoODeWvlCcztpfmdmpcD2nAmx5gVO4l6QgPmjnkX84s s1m/7crDeTfoUxCWZbIrkLfunsFuxU1FDunKkPaURfn7GKJNukehpUQY054BGCJ3R2xL /YkVgpGZ+euU3jaK57+YyLbzARV2rem0qZD8qU0EsUJ5nibsMSTmSGrKgSMw64MTPQMp OCk5PNbIBnTFNQgoduopLuBQ+btue02R9xtsqYpqtzVHcF6rZoohVC7bkbPLLI570w+D e79A== ARC-Authentication-Results: i=1; mx.google.com; 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 98si13467653ple.6.2019.08.20.14.27.49; Tue, 20 Aug 2019 14:28:04 -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; 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 S1730938AbfHTV0x (ORCPT + 99 others); Tue, 20 Aug 2019 17:26:53 -0400 Received: from fieldses.org ([173.255.197.46]:40596 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730858AbfHTV0x (ORCPT ); Tue, 20 Aug 2019 17:26:53 -0400 Received: by fieldses.org (Postfix, from userid 2815) id C91A21E3B; Tue, 20 Aug 2019 17:26:52 -0400 (EDT) Date: Tue, 20 Aug 2019 17:26:52 -0400 To: Max Kellermann Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com, bfields@redhat.com, tytso@mit.edu, adilger.kernel@dilger.ca, hughd@google.com, anna.schumaker@netapp.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 1/4] fs/posix_acl: apply umask if superblock disables ACL support Message-ID: <20190820212652.GB10909@fieldses.org> References: <20190713041200.18566-1-mk@cm4all.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190713041200.18566-1-mk@cm4all.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org What happened to these patches? All four make sense to me, for what it's worth; feel free to add a Reviewed-by: J. Bruce Fields --b. On Sat, Jul 13, 2019 at 06:11:57AM +0200, Max Kellermann wrote: > The function posix_acl_create() applies the umask only if the inode > has no ACL (= NULL) or if ACLs are not supported by the filesystem > driver (= -EOPNOTSUPP). > > However, this happens only after after the IS_POSIXACL() check > succeeeded. If the superblock doesn't enable ACL support, umask will > never be applied. A filesystem which has no ACL support will of > course not enable SB_POSIXACL, rendering the umask-applying code path > unreachable. > > This fixes a bug which causes the umask to be ignored with O_TMPFILE > on tmpfs: > > https://github.com/MusicPlayerDaemon/MPD/issues/558 > https://bugs.gentoo.org/show_bug.cgi?id=686142#c3 > https://bugzilla.kernel.org/show_bug.cgi?id=203625 > > Signed-off-by: Max Kellermann > Cc: stable@vger.kernel.org > --- > fs/posix_acl.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/fs/posix_acl.c b/fs/posix_acl.c > index 84ad1c90d535..4071c66f234a 100644 > --- a/fs/posix_acl.c > +++ b/fs/posix_acl.c > @@ -589,9 +589,14 @@ posix_acl_create(struct inode *dir, umode_t *mode, > *acl = NULL; > *default_acl = NULL; > > - if (S_ISLNK(*mode) || !IS_POSIXACL(dir)) > + if (S_ISLNK(*mode)) > return 0; > > + if (!IS_POSIXACL(dir)) { > + *mode &= ~current_umask(); > + return 0; > + } > + > p = get_acl(dir, ACL_TYPE_DEFAULT); > if (!p || p == ERR_PTR(-EOPNOTSUPP)) { > *mode &= ~current_umask(); > -- > 2.20.1