Files
linux/fs/nfs
Dai Ngo 0e9be90204 NFS: Fix LTP test failures when timestamps are delegated
[ Upstream commit b623390045 ]

The utimes01 and utime06 tests fail when delegated timestamps are
enabled, specifically in subtests that modify the atime and mtime
fields using the 'nobody' user ID.

The problem can be reproduced as follow:

# echo "/media *(rw,no_root_squash,sync)" >> /etc/exports
# export -ra
# mount -o rw,nfsvers=4.2 127.0.0.1:/media /tmpdir
# cd /opt/ltp
# ./runltp -d /tmpdir -s utimes01
# ./runltp -d /tmpdir -s utime06

This issue occurs because nfs_setattr does not verify the inode's
UID against the caller's fsuid when delegated timestamps are
permitted for the inode.

This patch adds the UID check and if it does not match then the
request is sent to the server for permission checking.

Fixes: e12912d941 ("NFSv4: Add support for delegated atime and mtime attributes")
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-11-24 10:37:35 +01:00
..
2024-09-23 15:03:13 -04:00
2024-09-23 15:03:30 -04:00
2023-03-06 09:57:12 +01:00
2025-07-14 15:20:02 -07:00
2024-11-08 14:17:37 -05:00
2025-06-10 22:21:16 -04:00
2025-05-15 12:14:29 +02:00