From patchwork Wed Jan 18 14:57:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chengen Du X-Patchwork-Id: 1728293 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Dzh6bEjG; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NxplM0FGSz23fT for ; Thu, 19 Jan 2023 01:57:35 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pI9sV-0007bW-Qm; Wed, 18 Jan 2023 14:57:27 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pI9sU-0007ZC-6H for kernel-team@lists.ubuntu.com; Wed, 18 Jan 2023 14:57:26 +0000 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id F2D5F3F5D6 for ; Wed, 18 Jan 2023 14:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1674053845; bh=HPmiBZo5bCpUETJn/YL8Hvx7YmtX2ptLmZ3hIT498uw=; h=From:To:Subject:Date:Message-Id:MIME-Version:Content-Type; b=Dzh6bEjGbcA7P7FkEmuJXNMCLucnB+fHl/ZtP2EppLeDCPmD5KjmirwieRXgpidOz xiAbb+VJfmbmejGRq/BFs1swqHDVtDizgWnt8aiF1sEdrgNYtXaWfpBLKunMPisdsj KyVR8CHOB/xXaPLv7dbTE7a7jZ5ft+MK4NmrmIpVrHstaladkBlFTWCbmaPmmbWMTm lo9I2iu3u/Phu5oUMPiKqfGvKPYY/oromyvSOgwawdqvVlTJd5uAWKdm4g4E/UVGAE /lrPouInQExOC1GneSXK8jSI625LOs3+DwR2SAqbiLN6Ot12Ykxn3r2g1p0t7xCOgt N8eY3EZ6dQrLA== Received: by mail-pl1-f198.google.com with SMTP id k5-20020a170902c40500b001947b539123so8486052plk.19 for ; Wed, 18 Jan 2023 06:57:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HPmiBZo5bCpUETJn/YL8Hvx7YmtX2ptLmZ3hIT498uw=; b=F95q2VyeCOOfJUtEke5F8arGquLD/SKwT5HDYpmGeI+y2Vt25uTWvIKU/uMVPjwRF1 Xb4tBex9qLKjYIt5EdU9c+IoYR/ZkXF22sOBiAWTbBtpyx5d7WgMJmbOiX2Jv0K+6FHL vOqTFYvIHD+AUaeikhiJr4Krapia3mUbC7O/Hdn04H4PYXYvOW+siiP4PwBb+j98BwkE p8svw3b5h+RYR/OVOgw4NJ6myzu85RAF+WCc4Rsr+jWYEauWX8+pyUuufzhNulf0/lFV Ap47vs0Tmt24owqB6TWV5sNTFcpCpQzHcPENpz/2/9c60Pqu2LFHQNm0QCMda5D2SO+T HMOg== X-Gm-Message-State: AFqh2krkrwcUfbb9Tp92JKAe5HkOE0TlzNqkMLUEVIGUV5HJ0Jdrx2HG XjSseVDOgyy/e9QAvElVMvr7jqQVFLEsEAYlmpdjsWwnPym0JxkCDv+5vHKqbRB2sbELj1ud+sm seHT7wB/ZeoC4PjWXE5aceUAjWWthMRr6f4SQpI5goQ== X-Received: by 2002:a62:154d:0:b0:58d:c649:b8ed with SMTP id 74-20020a62154d000000b0058dc649b8edmr7037572pfv.10.1674053844503; Wed, 18 Jan 2023 06:57:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXuoBpSDoNQxiVij5ylGl/9ZWu1Ahf2t1a4TQvD5kdLD66Ca50KaJcdqS7iov8lExdVzstrkog== X-Received: by 2002:a62:154d:0:b0:58d:c649:b8ed with SMTP id 74-20020a62154d000000b0058dc649b8edmr7037551pfv.10.1674053844198; Wed, 18 Jan 2023 06:57:24 -0800 (PST) Received: from chengendu.. (111-248-160-17.dynamic-ip.hinet.net. [111.248.160.17]) by smtp.gmail.com with ESMTPSA id o16-20020aa79790000000b00575caf8478dsm1885611pfp.41.2023.01.18.06.57.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 06:57:23 -0800 (PST) From: Chengen Du To: kernel-team@lists.ubuntu.com Subject: [SRU][Jammy][PATCH 0/3] NFS: client permission error after adding user to permissible group Date: Wed, 18 Jan 2023 22:57:18 +0800 Message-Id: <20230118145721.36032-1-chengen.du@canonical.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" [Impact] The NFS client's access cache becomes stale due to the user's group membership changing on the server after the user has already logged in on the client. The access cache only expires if either NFS_INO_INVALID_ACCESS flag is on or timeout (without delegation). Adding a user to a group in the NFS server will not cause any file attributes to change. The client will encounter permission errors until other file attributes are changed or the memory cache is dropped. [Fix] The access cache shall be cleared once the user logs out and logs back in again. 0eb43812c0270ee3d005ff32f91f7d0a6c4943af NFS: Clear the file access cache upon login 029085b8949f5d269ae2bbd14915407dd0c7f902 NFS: Judge the file access cache's timestamp in rcu path 5e9a7b9c2ea18551759833146a181b14835bfe39 NFS: Fix up a sparse warning [Test Plan] 1.[client side] testuser is not part of testgroup testuser@kinetic:~$ ls -ld /mnt/private/ drwxrwx--- 2 root testgroup 4096 Nov 24 08:23 /mnt/private/ testuser@kinetic:~$ mktemp -p /mnt/private/ mktemp: failed to create file via template ‘/mnt/private/tmp.XXXXXXXXXX’: Permission denied 2.[server side] add testuser into testgroup, which has access to folder root@kinetic:~$ usermod -aG testgroup testuser && echo `date +'%s'` > /proc/net/rpc/auth.unix.gid/flush 3.[client side] create a file again but still fail testuser@kinetic:~$ mktemp -p /mnt/private/ mktemp: failed to create file via template ‘/mnt/private/tmp.XXXXXXXXXX’: Permission denied [Where problems could occur] The fix will apply upstream commits, so the regression can be considered as low. Chengen Du (1): (upstream) NFS: Judge the file access cache's timestamp in rcu path Trond Myklebust (2): (upstream) NFS: Clear the file access cache upon login (upstream) NFS: Fix up a sparse warning fs/nfs/dir.c | 28 ++++++++++++++++++++++++++++ include/linux/nfs_fs.h | 1 + 2 files changed, 29 insertions(+) Acked-by: Tim Gardner Acked-by: Luke Nowakowski-Krijger