<div dir="ltr"><div>Acked-by: Luke Nowakowski-Krijger <<a href="mailto:luke.nowakowskikrijger@canonical.com">luke.nowakowskikrijger@canonical.com</a>><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 21, 2023 at 6:47 AM Chengen Du <<a href="mailto:chengen.du@canonical.com">chengen.du@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[Impact]<br>
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.<br>
The access cache only expires if either NFS_INO_INVALID_ACCESS flag is on or timeout (without delegation).<br>
Adding a user to a group in the NFS server will not cause any file attributes to change.<br>
The client will encounter permission errors until other file attributes are changed or the memory cache is dropped.<br>
<br>
[Fix]<br>
The access cache shall be cleared once the user logs out and logs back in again.<br>
<br>
0eb43812c0270ee3d005ff32f91f7d0a6c4943af NFS: Clear the file access cache upon login<br>
029085b8949f5d269ae2bbd14915407dd0c7f902 NFS: Judge the file access cache's timestamp in rcu path<br>
5e9a7b9c2ea18551759833146a181b14835bfe39 NFS: Fix up a sparse warning<br>
<br>
[Test Plan]<br>
1.[client side] testuser is not part of testgroup<br>
testuser@kinetic:~$ ls -ld /mnt/private/<br>
drwxrwx--- 2 root testgroup 4096 Nov 24 08:23 /mnt/private/<br>
testuser@kinetic:~$ mktemp -p /mnt/private/<br>
mktemp: failed to create file via template<br>
‘/mnt/private/tmp.XXXXXXXXXX’: Permission denied<br>
2.[server side] add testuser into testgroup, which has access to folder<br>
root@kinetic:~$ usermod -aG testgroup testuser &&<br>
echo `date +'%s'` > /proc/net/rpc/auth.unix.gid/flush<br>
3.[client side] create a file again but still fail<br>
testuser@kinetic:~$ mktemp -p /mnt/private/<br>
mktemp: failed to create file via template<br>
‘/mnt/private/tmp.XXXXXXXXXX’: Permission denied<br>
<br>
[Where problems could occur]<br>
The fix will apply upstream commits, so the regression can be considered as low.<br>
<br>
Chengen Du (1):<br>
(upstream) NFS: Judge the file access cache's timestamp in rcu path<br>
<br>
NeilBrown (1):<br>
(upstream) cred: add cred_fscmp() for comparing creds.<br>
<br>
Trond Myklebust (2):<br>
(upstream) NFS: Clear the file access cache upon login<br>
(upstream) NFS: Fix up a sparse warning<br>
<br>
fs/nfs/dir.c | 30 +++++++++++++++++++++++<br>
include/linux/cred.h | 1 +<br>
include/linux/nfs_fs.h | 1 +<br>
kernel/cred.c | 55 ++++++++++++++++++++++++++++++++++++++++++<br>
4 files changed, 87 insertions(+)<br>
<br>
-- <br>
2.17.1<br>
<br>
<br>
-- <br>
kernel-team mailing list<br>
<a href="mailto:kernel-team@lists.ubuntu.com" target="_blank">kernel-team@lists.ubuntu.com</a><br>
<a href="https://lists.ubuntu.com/mailman/listinfo/kernel-team" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/kernel-team</a><br>
</blockquote></div></div>