From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16B8EC001E0 for ; Mon, 23 Oct 2023 11:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233939AbjJWL0l (ORCPT ); Mon, 23 Oct 2023 07:26:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233936AbjJWL0k (ORCPT ); Mon, 23 Oct 2023 07:26:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FA2C100 for ; Mon, 23 Oct 2023 04:26:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B676C433C8; Mon, 23 Oct 2023 11:26:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698060397; bh=SV6BtxR0oVGgdR2P71txoRQvZJO3vGRjQ4IRH1Oruxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S0k6rj9+IS5V/f75mVZW9eEJAZNxPFpJfiKqZEE0ZNt0LF/ljKzgutK9O90IRhZJx NoixMPlUHhG0dWMu7GV12sIaz0mm295ZbXYyxFEV/dvYK2PPrh/2Z/ERUTZ5LrOinl 0ohnla7K47PsSy3Ox6gys/pZZB/A+W+Gqqkg3Kc8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Trond Myklebust , Dai Ngo , Jeff Layton , Anna Schumaker Subject: [PATCH 6.1 158/196] nfs42: client needs to strip file modes suid/sgid bit after ALLOCATE op Date: Mon, 23 Oct 2023 12:57:03 +0200 Message-ID: <20231023104832.922771366@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231023104828.488041585@linuxfoundation.org> References: <20231023104828.488041585@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dai Ngo commit f588d72bd95f748849685412b1f0c7959ca228cf upstream. The Linux NFS server strips the SUID and SGID from the file mode on ALLOCATE op. Modify _nfs42_proc_fallocate to add NFS_INO_REVAL_FORCED to nfs_set_cache_invalid's argument to force update of the file mode suid/sgid bit. Suggested-by: Trond Myklebust Signed-off-by: Dai Ngo Reviewed-by: Jeff Layton Tested-by: Jeff Layton Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs42proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -81,7 +81,8 @@ static int _nfs42_proc_fallocate(struct if (status == 0) { if (nfs_should_remove_suid(inode)) { spin_lock(&inode->i_lock); - nfs_set_cache_invalid(inode, NFS_INO_INVALID_MODE); + nfs_set_cache_invalid(inode, + NFS_INO_REVAL_FORCED | NFS_INO_INVALID_MODE); spin_unlock(&inode->i_lock); } status = nfs_post_op_update_inode_force_wcc(inode,