Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp683858rdb; Tue, 19 Sep 2023 07:21:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErNS9M/mQuhWEZHXwECnuz4Hb3sMELJgl3ojmw6OIm3r4YuVyR0NxneMMyjykYREMK0oWu X-Received: by 2002:a05:6a00:148c:b0:68f:c057:b54c with SMTP id v12-20020a056a00148c00b0068fc057b54cmr13510274pfu.1.1695133302188; Tue, 19 Sep 2023 07:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695133302; cv=none; d=google.com; s=arc-20160816; b=Ss3xFnExtBrfUaA5YSsOIMDgsmbDbtaGKkr0Z21hsj0BryvAQZnIaseso4Au6F7ZQb 4GpRkuxDOyRSzV2Y8WDHbeiUTT9Fj3B2ysxkIJYf6BB+AMGy4He+XWxZIJu/ff5WK4bO xcF+brekABJzigUbyKNG6KwqrCf1Xon0rQvCVmTuxc21hv/Y2v8J9ePjgf1J5SS8i5Qo TIA2FTLsTvsjlK3TlpzYEoOogbeCgPWiEvB4PMvQ0v58Ei7SQ7hoIYnTA08kBwrZxMwM F5vK69APeXJBu7pbqrq+smbxGEJH612wLXtfJ4N295dGzaGEA2aWsKyvn9tn4MWehUYj pLtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=uQ3b5XDPJFH4ZPU40U25cW209fS7oBevnKSE6H0Fn+w=; fh=tFO1AYymf86ey/KBx3xeOspWWkYnYg0Z9DpvnRcao6U=; b=XnOmFUqCoUUjKd314EVm0KIODjYhvkzKZGYZqkiZteiAdCs0xLxbCOra2JF9RFXcwd xlTqgNMlFWqJi1KU5RdBcZv2LjXWBgdIaL1zatPL9J2hh8EfrshJWDycUX1vtSebzMdx 79R4A7jtMfEyYIASG4jZZDfWbI2WGqYZm8WGzrBXboS0cNOib/IRAVFqSdmPVbNotLeU fPFjbMAL3mApopiVVWAY5T+StU0+lOtAjUoKuuDIzMg2fbVzINYZtJ1qvgKKuOA6aHRt X4Dt1ZddAMQm2WRHP9iO7vztv+4Ss+bRrqRoiI47kBmEjFUCw6s1pzQQnhgBZ0wXF7iY bOYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=KzoOHEfh; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id dw8-20020a056a00368800b0068fef37e5c4si9650659pfb.237.2023.09.19.07.21.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 07:21:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=KzoOHEfh; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 728DE80BA7C7; Tue, 19 Sep 2023 01:19:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230384AbjISITZ (ORCPT + 99 others); Tue, 19 Sep 2023 04:19:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231528AbjISITN (ORCPT ); Tue, 19 Sep 2023 04:19:13 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54CBF133 for ; Tue, 19 Sep 2023 01:19:05 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-402d0eda361so58505895e9.0 for ; Tue, 19 Sep 2023 01:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1695111543; x=1695716343; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uQ3b5XDPJFH4ZPU40U25cW209fS7oBevnKSE6H0Fn+w=; b=KzoOHEfhKeHgv3tW4kwS9gSnmAtZ5Rq+pU6CPB/nWtxEUsL/EwlR9Dd03v5Z5FCR3w tBHZjwTkWTKkr5hmuryTkvMnPbfUnTQcwBkWDVPVGQxyBfRYVFzIjXBWHblINS93SKte DoHXm8RvZNysOQq8W+HleSyqmNje4rSGg3DiB+WVmTNAPQDB1Ffa23sEQZslg+Bs149B 908eW/TAKcGqJApx6IooII/tMUGE6xSasunCs4/8EPWFo3Lrh+gQQn6Il2af8n4v+QOw jJsPmXw038aahZzML2ZivL1jYA7AfM6x6Eq8h76vr/kaIh9Ndn9aUNLrjrikihJkynWD /GKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695111543; x=1695716343; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uQ3b5XDPJFH4ZPU40U25cW209fS7oBevnKSE6H0Fn+w=; b=N+v/R1ZCcCTPLhU0QkBzhtxKDvqAwEZfFuAJs+hwRWT6ucfLtWpeiVHy/+H26MMMzp JgwgO8nqjHTzouMWmKxWvoVlBNGzgrVr4RJeD3IWDxt54kHwZqf6+CmIDbgo7gys9V9p P53PAWi8430BVMI5OxAZhvSX/9nndtzgQre7eKv4qE8/DoOqoRiHVT1+M+igdz4M/aBF dgZpS6ujmCnyc01KrPzTo6QWVyeTAN0rz2bFu2+bACH0f6sS7b4Xk7CYfzCdprb8C29C 04A5Tv83kls5D2daiILVhR1vW64m8N2OFTkhS4l4syZ7bG3/1JU3MeWWLxcqQbGy5LK+ JocQ== X-Gm-Message-State: AOJu0YzVgOcibra7bZowf06rOzQo7i/kEwgmjvKHMylB3zk323ldCi3D /olYEexlP3z1o6E1ANFixeRyOSgZ8GrkgOOFeoP3UA== X-Received: by 2002:a7b:ca4a:0:b0:401:c297:affb with SMTP id m10-20020a7bca4a000000b00401c297affbmr10412073wml.37.1695111543658; Tue, 19 Sep 2023 01:19:03 -0700 (PDT) Received: from heron.intern.cm-ag (p200300dc6f209c00529a4cfffe3dd983.dip0.t-ipconnect.de. [2003:dc:6f20:9c00:529a:4cff:fe3d:d983]) by smtp.gmail.com with ESMTPSA id i10-20020a5d558a000000b003141e629cb6sm14762549wrv.101.2023.09.19.01.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 01:19:02 -0700 (PDT) From: Max Kellermann To: Xiubo Li , Ilya Dryomov , Jeff Layton , Jan Kara , Dave Kleikamp Cc: Max Kellermann , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, jfs-discussion@lists.sourceforge.net Subject: [PATCH] fs: apply umask if POSIX ACL support is disabled Date: Tue, 19 Sep 2023 10:18:59 +0200 Message-Id: <20230919081900.1096840-1-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 19 Sep 2023 01:19:22 -0700 (PDT) Signed-off-by: Max Kellermann --- fs/ceph/super.h | 1 + fs/ext2/acl.h | 1 + fs/jfs/jfs_acl.h | 1 + include/linux/posix_acl.h | 1 + 4 files changed, 4 insertions(+) diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 51c7f2b14f6f..e7e2f264acf4 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -1194,6 +1194,7 @@ static inline void ceph_forget_all_cached_acls(struct inode *inode) static inline int ceph_pre_init_acls(struct inode *dir, umode_t *mode, struct ceph_acl_sec_ctx *as_ctx) { + *mode &= ~current_umask(); return 0; } static inline void ceph_init_inode_acls(struct inode *inode, diff --git a/fs/ext2/acl.h b/fs/ext2/acl.h index 4a8443a2b8ec..694af789c614 100644 --- a/fs/ext2/acl.h +++ b/fs/ext2/acl.h @@ -67,6 +67,7 @@ extern int ext2_init_acl (struct inode *, struct inode *); static inline int ext2_init_acl (struct inode *inode, struct inode *dir) { + inode->i_mode &= ~current_umask(); return 0; } #endif diff --git a/fs/jfs/jfs_acl.h b/fs/jfs/jfs_acl.h index f892e54d0fcd..10791e97a46f 100644 --- a/fs/jfs/jfs_acl.h +++ b/fs/jfs/jfs_acl.h @@ -17,6 +17,7 @@ int jfs_init_acl(tid_t, struct inode *, struct inode *); static inline int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir) { + inode->i_mode &= ~current_umask(); return 0; } diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 0e65b3d634d9..54bc9b1061ca 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h @@ -128,6 +128,7 @@ static inline void cache_no_acl(struct inode *inode) static inline int posix_acl_create(struct inode *inode, umode_t *mode, struct posix_acl **default_acl, struct posix_acl **acl) { + *mode &= ~current_umask(); *default_acl = *acl = NULL; return 0; } -- 2.39.2