Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp778127rdg; Wed, 11 Oct 2023 05:28:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDxs21ak45zflsfb03RfgAdNqgzv4R+cg4yxD2EFQMKkm9UYRC4G0MSQSOaR1RZWTOtIoP X-Received: by 2002:a05:6a00:234a:b0:68f:b5a1:12bf with SMTP id j10-20020a056a00234a00b0068fb5a112bfmr24670565pfj.29.1697027292644; Wed, 11 Oct 2023 05:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697027292; cv=none; d=google.com; s=arc-20160816; b=imvK2fEzZtHdRhv+r1ci5fbXQ/TGnG6d89oQc7bW8Sbtjs27MeS8+iD/LOBL7DJCrb DmsfcjBILeRSKNrFEWkWEimhdA/JqkSG5PF+dudlqRf4KjzjWttZyij8lNdQPR9YWm/l ZIbxNQ6Aw7COAy0kBip1vGd1yH2cmwPzpQCS8H0Zz7cnlgbSxhcXS5IZnljXgxb91XFf Oytu9tMZbWUy+Uu1srhyDbZiRhVAc3k7VjutV72/3KW1seed94R64cgqtmkUX64CDBpC C7ogq8u74wwBDMuViDZKV6m8qB2LlyyuHA/cAnX71z1H4Vt90+JRXInoSYdWo2Zn+gZT s1Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KhRvlvbfNNUdcA0ulFhXxzCGgb7/Qvy9mlYrvDGbA4o=; fh=Kdk1kapUfsDLjd4M8RHP1Lz2aGDs2OrVms5wXqwdo0o=; b=UGFeMhryOJSV6Z3hTpfYDF00nx0N6Gw3uiFTxrW1JimZl7SEadYu2agYaJizUE6E0T ggloBVvpMogN7wF0j3waDuEUdgDY5d1rLizEEsESMS5pK1oYRioCl8KVT92K5xkHheX7 He9USFR+9toN5o2/tF7shvi62+AbyWV2DCGRVUxmH5lb7Hw9vAGmpSHB7Pgbv86J/4DS Xv8VfUR4HMw1cXMbX7UAEV0NCrUi6KhuzhKAiBURMD0bJ7Z4381crnNdK4RQgdnfEZcZ ue2y/OW1bl0bMn4eh8Yp3ZMxVtn8+g3IooL2GE8OOQQ3sJv4stLR5q8XBvSb+Ri2gZzY 24Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="cN/B8LVK"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id w8-20020a63f508000000b005898cf1c6a0si10353428pgh.324.2023.10.11.05.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 05:28:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="cN/B8LVK"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 1387D836E254; Wed, 11 Oct 2023 05:28:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235006AbjJKM2F (ORCPT + 99 others); Wed, 11 Oct 2023 08:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232126AbjJKM2E (ORCPT ); Wed, 11 Oct 2023 08:28:04 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 816C3C0 for ; Wed, 11 Oct 2023 05:28:02 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c28e35752cso87324001fa.0 for ; Wed, 11 Oct 2023 05:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1697027281; x=1697632081; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KhRvlvbfNNUdcA0ulFhXxzCGgb7/Qvy9mlYrvDGbA4o=; b=cN/B8LVK20ID3cbRoHCdy85aDxhYW2bmTgNYSKyMhID1L5XtN/oCGUaoeKe0Y8qR6V wWIcc9/V+S7SiC8cULvP2OrtOpaMyKK/xw44uWnuv/OkNfMDBwPReT3JjL3YgoFjQ2JG eMvcAX/djqNLa4MIq12a/tDfzZDrCO9MP10S907p8KYEdGanslH0PbbiUukqTbaTDgT7 FpCz5dp/as2SM+evOuVmYCY4dAdRPCjrzoB8LMab9XyIXK+uF75rd5yfdaDlfU3NgzI3 AijvrX3A4+QD/dwiAEzS9mMaz/jjwOUg82oUPDYbQT27fy5FIf7apoAf6Za5649y3D/c lsxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697027281; x=1697632081; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KhRvlvbfNNUdcA0ulFhXxzCGgb7/Qvy9mlYrvDGbA4o=; b=CSyuhsiWaJRYCWYO2Pzcc2aDLksFCskwAzFeVLx/ju7EqklKui+o1xiFUKAY8dRtsg /bUWXz/VqBaOaPoqXrMdfLW0tiTdG46fLKlev6ZfGex2k8cIsPH3f3rRWFg28Cu/0x7m wGm1MuyeWsk7Ksjb6Qeuau3yF58rcseB3qlMkrGlTrqf4R/koMca4apSnXIlnn6lfWWx QqdhsQ9JkD3DUNYmVOjjmNNBqGjA9CTu1VQoQa2uPALSWs/DsIBFxF7AM2mY916zZurx q99tk6lqjKZj696Dp5dYmuj9ONO/Cx+t0rpt90pXv7v00zIvSjC0eSs0ehqTpqTpJpIA D+1w== X-Gm-Message-State: AOJu0Yzhiky4mlYpeFDuxX5sQavjhWnOzG3Ui8eTcl9stK7mlGfwmC3w tIit2V0pKH1gD/XKn+vDYFiuD7pTQOKUM36ex4kNcA== X-Received: by 2002:a2e:998a:0:b0:2bc:b75e:b8b with SMTP id w10-20020a2e998a000000b002bcb75e0b8bmr18178845lji.38.1697027280733; Wed, 11 Oct 2023 05:28:00 -0700 (PDT) MIME-Version: 1.0 References: <69dda7be-d7c8-401f-89f3-7a5ca5550e2f@oracle.com> <20231009144340.418904-1-max.kellermann@ionos.com> <20231010131125.3uyfkqbcetfcqsve@quack3> <20231011100541.sfn3prgtmp7hk2oj@quack3> <20231011120655.ndb7bfasptjym3wl@quack3> In-Reply-To: From: Max Kellermann Date: Wed, 11 Oct 2023 14:27:49 +0200 Message-ID: Subject: Re: [PATCH v2] fs/{posix_acl,ext2,jfs,ceph}: apply umask if ACL support is disabled To: Jan Kara Cc: Xiubo Li , Ilya Dryomov , Jeff Layton , Jan Kara , Dave Kleikamp , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, jfs-discussion@lists.sourceforge.net, Christian Brauner , Yang Xu , linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Wed, 11 Oct 2023 05:28:08 -0700 (PDT) X-Spam-Level: ** On Wed, Oct 11, 2023 at 2:18=E2=80=AFPM Max Kellermann wrote: > But without the other filesystems. I'll resend it with just the > posix_acl.h hunk. Thinking again, I don't think this is the proper solution. This may server as a workaround so those broken filesystems don't suffer from this bug, but it's not proper. posix_acl_create() is only supposed to appy the umask if the inode supports ACLs; if not, the VFS is supposed to do it. But if the filesystem pretends to have ACL support but the kernel does not, it's really a filesystem bug. Hacking the umask code into posix_acl_create() for that inconsistent case doesn't sound right. A better workaround would be this patch: https://patchwork.kernel.org/project/linux-nfs/patch/151603744662.29035.491= 0161264124875658.stgit@rabbit.intern.cm-ag/ I submitted it more than 5 years ago, it got one positive review, but was never merged. This patch enables the VFS's umask code even if the filesystem prerents to support ACLs. This still doesn't fix the filesystem bug, but makes VFS's behavior consistent. Max