]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
NFS: Fix LTP test failures when timestamps are delegated
authorDai Ngo <dai.ngo@oracle.com>
Sun, 9 Nov 2025 17:05:08 +0000 (09:05 -0800)
committerAnna Schumaker <anna.schumaker@oracle.com>
Mon, 10 Nov 2025 21:55:12 +0000 (16:55 -0500)
commitb623390045a81fc559decb9bfeb79319721d3dfb
tree198d50ed79a72154ae2bd9c45f570e5d8a310431
parent1f214e9c3aef2d0936be971072e991d78a174d71
NFS: Fix LTP test failures when timestamps are delegated

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: e12912d94137 ("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>
fs/nfs/inode.c