Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp797275lqb; Fri, 15 Mar 2024 06:53:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGFfLbiKheuMOnB86iRROjxvoUdHH/zYw3JzyA05Gk7ZUYp067GuOU6D2V7G6FHmI+k+oOB0RAo9zA0qrQ3mG/XAqL/y9Ci+yZ+eUKqA== X-Google-Smtp-Source: AGHT+IGf8c53l6sBtVkiZgRIxtZZ8I/QV9K4d1YZWc3DgDo4BmcP1PyVixATTqMK05yw+mmPteeT X-Received: by 2002:a05:622a:1305:b0:430:a20f:5aed with SMTP id v5-20020a05622a130500b00430a20f5aedmr4410702qtk.0.1710510814761; Fri, 15 Mar 2024 06:53:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710510814; cv=pass; d=google.com; s=arc-20160816; b=Svbd7ULRWF7AOD9k6dqXYXIrfpN91Fhz0/ODYwN5GkTLD28qGUbQ5XCCgSnPjyS+mT +RAfh9ZkN4L8sT51WdVXG851VJEFYNt+fuP0IBP+aEzhl87B04QbsbdMoxHWi1ZIjLm0 USnlp/lHoqY7f5n5O7Tdt0vMyOCZ+2hFESlNHesl5TOhih0rruWpPqiHv0YK9IvKTmMt 2lY2b74DE0rk+VTvY8QYDwoNPY6A5iapsoz1oo/BAsPQDqkoAwNJG26R2SCu73jetpxq UayZoDYtKypz4fHO7hSXuOpbNZkxl3Lkz24x6RNMkHqX1s6+wpmKeeAc5C75NODW9p90 QhgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zUEC+cpHkmIQsm7OSX3kZTD8R0Ar9UdLJ5REZaa2bJM=; fh=VCrBH6LcIHDIhX9DxqnGuWJEzp7lifXoArr+eytgEjM=; b=fP1OTfZMHMvU1kQl13MPYCpJJfxjk5q4Ci/CQpzdTXsYMOMoJ/Kf47FY9CmyckroHM 2oddRXWRU6izWxl9sTMnniPX3YhGGJOJaeHTBRGJ37gupjB2mntGkSzlEpzriL4H7FTT DFgoJsxko6smAIBDlApF0nNDIwwqdexK+gHgq3eVGKg3o7byDLrBWKMjkETagJoa4Akc f52XG7Fhk1yJUJ6HRI0fIXjKihWwOuMrvmIxos4rpWBhRz5hmEhi+80AKzqPgiiUTYCA 6VWx9wv79CVLv6XRbWY7IcwDaop5e1Pf4KUeRAZx98R2vVEuh4vMxzIdiLktEWPd2l8X WBGA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kqzhkH+o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-ext4+bounces-1661-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1661-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o5-20020a05622a008500b0042ef3a4fec6si3706979qtw.113.2024.03.15.06.53.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 06:53:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1661-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kqzhkH+o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-ext4+bounces-1661-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1661-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7D0B11C21863 for ; Fri, 15 Mar 2024 13:53:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87FD436AF1; Fri, 15 Mar 2024 13:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kqzhkH+o" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0028D1BF28; Fri, 15 Mar 2024 13:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710510751; cv=none; b=tyK6kWTR47P7OgCXIoVttOsR01TODiI4PMzcjQEGrtSmNJ2JpA7UnPg6d+RnZ6TMDVVyq26BMWDveuUrc3wd6Y+VmBb9+MycYL3euGtha0eHBCKLDCmHlMGO14B/6rIaXkOIQ0ckZBBvNZN9TjT3xFBNSSlwR6p9NThL7GqJMLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710510751; c=relaxed/simple; bh=AwIVao3rL1Q0k95nqbmA9y6yqrp6LGbk8gB2bmRe7uc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=taeTNxw00RvkGCdDWgHYwcqBVGsdzARCzw0oCSyNtTH/T0wY42HvbhKhmBE094zugFdz8huq37O8rhfasfNTHFPbUf1P4PpUJWgbZrMvc+J8qK2KED6/hyRw8h5vY14n16ph1MfwcVgr1vOCT5tCxtW2SXifB6SfeCnIl/ttje8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kqzhkH+o; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B09DAC433F1; Fri, 15 Mar 2024 13:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710510750; bh=AwIVao3rL1Q0k95nqbmA9y6yqrp6LGbk8gB2bmRe7uc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kqzhkH+oA5Y2fdTLJi8P7w3/r/btamKmCo690KIn0ZIru45tU+mFtEtMiGSX5ypl3 eag+OprokOmKCLgl2aoLS2XP8c22mUJCeYuhzqPDQKZKotfiaHFSMbXoHafhzQ0lUF b0ir/DnTenexQYigIBvpmNaNILaV6Ms5+c50uObeXes8h8ocxmea6QGAv9wWj1fKus iJ2l+PrwBcmk9hOfcK2YZhzxZsRpnlzO7bVQpYkBGQiqv2S9F6m15Cfcf8rnMFUoOh 1fpt0GgXfkjKW4maiZuN4RnGAx7JVqk09IsKrg3GpmBhIfJ+InRsJWFbse65QceJTs JaRfYJRY7AatQ== Date: Fri, 15 Mar 2024 14:52:24 +0100 From: Christian Brauner To: Max Kellermann Cc: Michael Forney , Jan Kara , Theodore Ts'o , 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, Yang Xu , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2] fs/{posix_acl,ext2,jfs,ceph}: apply umask if ACL support is disabled Message-ID: <20240315-hasst-anmachen-4c9e89a56840@brauner> References: <20231011135922.4bij3ittlg4ujkd7@quack3> <20231011-braumeister-anrufen-62127dc64de0@brauner> <20231011170042.GA267994@mit.edu> <20231011172606.mztqyvclq6hq2qa2@quack3> <20231012142918.GB255452@mit.edu> <20231012144246.h3mklfe52gwacrr6@quack3> <28DSITL9912E1.2LSZUVTGTO52Q@mforney.org> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Mar 14, 2024 at 02:08:04PM +0100, Max Kellermann wrote: > On Wed, Mar 13, 2024 at 9:39 PM Michael Forney wrote: > > Turns out that symlinks are inheriting umask on my system (which > > has CONFIG_EXT4_FS_POSIX_ACL=n): > > > > $ umask 022 > > $ ln -s target symlink > > $ ls -l symlink > > lrwxr-xr-x 1 michael michael 6 Mar 13 13:28 symlink -> target > > $ > > > > Looking at the referenced functions, posix_acl_create() returns > > early before applying umask for symlinks, but ext4_init_acl() now > > applies the umask unconditionally. > > Indeed, I forgot to exclude symlinks from this - sorry for the breakage. > > > After reverting this commit, it works correctly. I am also unable > > to reproduce the mentioned issue with O_TMPFILE after reverting the > > commit. It seems that the bug was fixed properly in ac6800e279a2 > > ('fs: Add missing umask strip in vfs_tmpfile'), and all branches > > that have this ext4_init_acl patch already had ac6800e279a2 backported. > > I can post a patch that adds the missing check or a revert - what do > the FS maintainers prefer? If it works correctly with a revert we should remove the code rather than adding more code to handle a special case. > > (There was a bug with O_TMPFILE ignoring umasks years ago - I first > posted the patch in 2018 or so - but by the time my patch actually got > merged, the bug had already been fixed somewhere else IIRC.) Yeah, we fixed it a while ago and then I added generic VFS level umask handling but POSIX ACL are hurting us because they're a massive layering violation on that front.