Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2123536ybt; Mon, 15 Jun 2020 19:42:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPeEQ4C4QKnlyfW7WQooqabyKEt++Wb1oPIDeZqYrrbUAFEKLuzD5Bbx7TgDsx1P1g2R/F X-Received: by 2002:a17:906:f6c2:: with SMTP id jo2mr750180ejb.424.1592275369001; Mon, 15 Jun 2020 19:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592275368; cv=none; d=google.com; s=arc-20160816; b=y3erNdEXCEzB3zVnVli04ZRUJHTdUPVegtQrvh2jfVQcyID3PgftklWTyjxqYAIyB9 9h3hv2Uz4VzbYxqMpUxnO6aFK0chTeS9BONeCWS8VWgNVQiM3o3hO/HFgSxbXy44Uc1G AbWa3St6tX9T05Bq59TdRXXLddHGJ88T9crulJvdqlnPkHKYO2A6PBGwNTmTdWh+1u9i NflWMVDEENsNnnByz98BKB3tlPZ0/3rl56VaKRtdhI5ZJwoMdl0GxTv7KafkTlxD1a6K tWby36PmfHnznkp2NTXwfvIcC7JY7A9hXHJn1QcVnXsxyEBmEjU40k9kFzK+hY5X5mSE KOkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=LuL3S3uOf3SoFRqVHBGN1+EkozcHXriR0GzHlci2TC8=; b=HQb8c97wr6VpVrV4QmHuKBNOpmmd3eF9MkfXwvynATV/0UVFEs5LqvNcYe1q0l36cI 3E6iGI5wzQnpX1R5JqS1gw7HFioqrJdOJTfS//g4MGsmt0m9zNWTfv917JkptfnLjvZ7 UCtaT5e/ZS5uhrwyZh7s4LxHGhY1+1jKJew4nc6Jx0CzJfpMcqm4fnWscwtKPcItlS39 oji90HryD0YQ4+1WihAe5/3ACNvrbpP0hqeiWCp0tyR94ZtD+lYYzYlmsNxUCGtkYTU3 5KSn5s3JwQPAaPaq9RzefqiBAOmrxz6ASoi+UMaK8ErntAfduRees+hRFWEJCz5+OvRQ lh9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J6f5Lz+U; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e13si9920818ejd.417.2020.06.15.19.42.25; Mon, 15 Jun 2020 19:42:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@redhat.com header.s=mimecast20190719 header.b=J6f5Lz+U; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726101AbgFPCmS (ORCPT + 99 others); Mon, 15 Jun 2020 22:42:18 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:21195 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726044AbgFPCmS (ORCPT ); Mon, 15 Jun 2020 22:42:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592275337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LuL3S3uOf3SoFRqVHBGN1+EkozcHXriR0GzHlci2TC8=; b=J6f5Lz+Ud6sI9mFoM9x6J0LQEHAfKPNAvumsgChKziP3wEL4TT/B/D1w1+Hm8v1p6GEWTZ 5iN4/3qGUfR1z6G/C1/d6/DL4kt9YZIdmX1oRrx8JqPkU2G6YT9fM3uMlqaZ3+MCu5bJPx PyFua5I36BIvGS8nZ0etDjaGbe0nnDc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-346-yQgfCwFbM-mTgCByinuOGQ-1; Mon, 15 Jun 2020 22:42:15 -0400 X-MC-Unique: yQgfCwFbM-mTgCByinuOGQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4401F106B247; Tue, 16 Jun 2020 02:42:14 +0000 (UTC) Received: from pick.fieldses.org (ovpn-118-200.rdu2.redhat.com [10.10.118.200]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 22B1F10013D6; Tue, 16 Jun 2020 02:42:14 +0000 (UTC) Received: by pick.fieldses.org (Postfix, from userid 2815) id DD405120476; Mon, 15 Jun 2020 22:42:12 -0400 (EDT) Date: Mon, 15 Jun 2020 22:42:12 -0400 From: "J. Bruce Fields" To: Salvatore Bonaccorso Cc: Elliott Mitchell , 962254@bugs.debian.org, linux-nfs@vger.kernel.org, agruenba@redhat.com Subject: Re: Umask ignored when mounting NFSv4.2 share of an exported Filesystem with noacl (was: Re: Bug#962254: NFS(v4) broken at 4.19.118-2) Message-ID: <20200616024212.GC214986@pick.fieldses.org> References: <20200605064426.GA1538868@eldamar.local> <20200605051607.GA34405@mattapan.m5p.com> <20200605174349.GA40135@mattapan.m5p.com> <20200605183631.GA1720057@eldamar.local> <20200611223711.GA37917@mattapan.m5p.com> <20200613125431.GA349352@eldamar.local> <20200613184527.GA54221@mattapan.m5p.com> <20200615145035.GA214986@pick.fieldses.org> <20200615185311.GA702681@eldamar.local> <20200616023820.GB214986@pick.fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200616023820.GB214986@pick.fieldses.org> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Jun 15, 2020 at 10:38:20PM -0400, J. Bruce Fields wrote: > Thanks for the detailed reproducer. > > It's weird, as the server is basically just setting the transmitted > umask and then calling into the vfs to handle the rest, so it's not much > different from any other user. But the same reproducer run just on the > ext4 filesystem does give the right permissions.... > > Oh, but looking at the system call, fs_namei.c:do_mkdirat(), it does: > > if (!IS_POSIXACL(path.dentry->d_inode)) > mode &= ~current_umask(); > error = security_path_mkdir(&path, dentry, mode); > if (!error) > error = vfs_mkdir(path.dentry->d_inode, dentry, mode); > > whereas nfsd just calls into vfs_mkdir(). > > And that IS_POSIXACL() check is exactly a check whether the filesystem > supports ACLs. So I guess it's the responsibility of the caller of > vfs_mkdir() to handle that case. But, that's unsatisfying: why isn't vfs_mkdir() taking care of this itself? And what about that security_path_mkdir() call? And are the other cases of that switch in fs/nfsd/vfs.c:nfsd_create_locked() correct? I think there may be some more cleanup here called for, I'll poke around tomorrow. --b.