Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp952846pxb; Thu, 24 Mar 2022 09:53:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBb/OsjlEDY+UTEAilG3tWXy3PYCUDjeaLLyIimDEKQzOTx10Gd4LhN5jvP7asxhI2bi5p X-Received: by 2002:a05:6a00:2990:b0:4fa:dacf:2e3 with SMTP id cj16-20020a056a00299000b004fadacf02e3mr5758934pfb.67.1648140795426; Thu, 24 Mar 2022 09:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648140795; cv=none; d=google.com; s=arc-20160816; b=B8JsNf6YltT243DrIhSJxW2Gw9vM3VHvpf7JNnDXD5q6qLTfcRydFoZUYxA8aBwsEV F3rtpHJ+oazUCDdk2PVtGAETFesZB4Pd/dgDms97gC2VhqzDf9+PAhbqFM0g4e1cskxz u1TtfH8ynvmeC4hgaNvVMy74d3DWetvQl2+p4T0X/jAOTsf7K+Otg+nCkME8zVM6NWiA ZcTlw5NBuzLp4Rz0Ccds7ghKSwbF3m8FLtsoNkn5p3BcQN9HmszG12SB7u2nWJwyLmxH 6g/R4zH8TxlA9QRNoRDKutPgHLwRzrOfDRc88iAEbRVDeyrYDfQfzEC8mBdZix9/4Dew Ajiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=IgI7iSs4c3xiyNn0W/1GkCQVR6hrsFDVMCUfZ9Pn6Kg=; b=wRMuXHW7HboTBCI5UItvm3WNaYrQrJqfeCOLm8McRNKRf/JovQRRT7pc8xZARqbDlt k0uNDrJ/g+1+k8eh7p13gW2MZTMdIllriYmH9GEXWeGxMfEDElNXvZRDoGKDSYjq8F3/ UZTqG9yckJenJKXV6q1DG5IXK4ouZUoxDDXC5ZP64HAW1iXWzqp/uLMoJ77VUqlFFYmt w9sJ1uz5WyUoX3j+XfWpvVQHryByrTmAo84LbNYUIUbaveHN3y/AAfaZwWfs5MISOcj4 1YeRqcS+t+xnTfVEV2yCnZ2GMqk9/lnstr91CH7Uh4VASXtEJ8J7DEDGz/qB4IbdTPok tmEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 97-20020a17090a09ea00b001bd5400b61esi3945969pjo.86.2022.03.24.09.52.55; Thu, 24 Mar 2022 09:53:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242275AbiCXO4u (ORCPT + 99 others); Thu, 24 Mar 2022 10:56:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347268AbiCXO4t (ORCPT ); Thu, 24 Mar 2022 10:56:49 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D75A89302 for ; Thu, 24 Mar 2022 07:55:17 -0700 (PDT) Received: from cwcc.thunk.org (pool-108-7-220-252.bstnma.fios.verizon.net [108.7.220.252]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 22OEtATC027993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Mar 2022 10:55:11 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id B2A3915C0038; Thu, 24 Mar 2022 10:55:10 -0400 (EDT) Date: Thu, 24 Mar 2022 10:55:10 -0400 From: "Theodore Ts'o" To: "Darrick J. Wong" Cc: linux-ext4 Subject: Re: [PATCH] ext4: fix fallocate to use file_modified to update permissions consistently Message-ID: References: <20220308185043.GA117678@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220308185043.GA117678@magnolia> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Mar 08, 2022 at 10:50:43AM -0800, Darrick J. Wong wrote: > From: Darrick J. Wong > > Since the initial introduction of (posix) fallocate back at the turn of > the century, it has been possible to use this syscall to change the > user-visible contents of files. This can happen by extending the file > size during a preallocation, or through any of the newer modes (punch, > zero, collapse, insert range). Because the call can be used to change > file contents, we should treat it like we do any other modification to a > file -- update the mtime, and drop set[ug]id privileges/capabilities. > > The VFS function file_modified() does all this for us if pass it a > locked inode, so let's make fallocate drop permissions correctly. > > Signed-off-by: Darrick J. Wong Applied, thanks! (BTW, when you reply to a patch with a different patch, such as in this case, "fstests: ensure we drop suid after fallocate", it hopelessly confuses b4, which is why I'm sending this notification manually. Try running "b4 am 20220308185043.GA117678@magnolia" and compare that to https://lore.kernel.org/r/20220308185043.GA117678@magnolia and you'll see what I mean.) - Ted