lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250726-nfsd-testing-v2-0-f45923db2fbb@kernel.org>
Date: Sat, 26 Jul 2025 10:31:54 -0400
From: Jeff Layton <jlayton@...nel.org>
To: Alexander Viro <viro@...iv.linux.org.uk>, 
 Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>, 
 Steven Rostedt <rostedt@...dmis.org>, 
 Masami Hiramatsu <mhiramat@...nel.org>, 
 Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, 
 Chuck Lever <chuck.lever@...cle.com>, NeilBrown <neil@...wn.name>, 
 Olga Kornievskaia <okorniev@...hat.com>, Dai Ngo <Dai.Ngo@...cle.com>, 
 Tom Talpey <tom@...pey.com>
Cc: Trond Myklebust <trondmy@...merspace.com>, 
 Anna Schumaker <anna@...nel.org>, linux-fsdevel@...r.kernel.org, 
 linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, 
 linux-nfs@...r.kernel.org, Jeff Layton <jlayton@...nel.org>
Subject: [PATCH v2 0/7] nfsd/vfs: fix handling of delegated timestamp
 updates

After my last posting, Trond pointed out that my interpretation of RFC
9754 was wrong. The "original time" as mentioned in the spec is the time
of the grant of the delegation, and not the current timestamp in the
inode before the update.

Given that, there is no longer a need to do any sort of complicated
handling of delegated timestamps at the VFS layer, so this set removes
inode_set_ctime_deleg(). We do however need a way to set a ctime that
isn't current_time() via notify_change(). This patchset adds an
ATTR_CTIME_SET flag, which mirrors ATTR_ATIME_SET and ATTR_MTIME_SET
semantics. The rest of the patchset reworks nfsd to properly vet
timestamp updates on its own and just call down into the OS to do a
normal notify_change().

With this patchset in place I haven't seen any git regression suite
failures yet (4 passes so far under kdevops in the "stress"
configuration).

I should point out that there is at least one potential problem with
this implementation:

The kernel does not block getattr operations when there is a delegation
outstanding. When the client issues read and write ops to the server,
while holding the delegation, the timestamps on the file get updated to
the server's time as usual. Later, the client will send a SETATTR (or a
CB_GETTTR reply) that may have times that are earlier than the
timestamps currently on the inode.

This means that userland applications running on the NFS server can
observe timestamps going backward. This applies even for the ctime. NFS
clients should be fine, as the server will do a CB_GETATTR to satisfy
them. Server-side applications can't do much else with the inode without
recalling the delegation, so my thinking is that the effect should be
"mostly harmless".

Signed-off-by: Jeff Layton <jlayton@...nel.org>
---
Changes in v2:
- add ATTR_CTIME_SET and remove inode_set_ctime_deleg()
- track original timestamps in struct nfs4_delegation
- fix delegated timestamp updates to respect saved timestamps
- Link to v1: https://lore.kernel.org/r/20250722-nfsd-testing-v1-0-31321c7fc97f@kernel.org

---
Jeff Layton (7):
      vfs: add ATTR_CTIME_SET flag
      nfsd: ignore ATTR_DELEG when checking ia_valid before notify_change()
      nfsd: use ATTR_CTIME_SET for delegated ctime updates
      nfsd: track original timestamps in nfs4_delegation
      nfsd: fix SETATTR updates for delegated timestamps
      nfsd: fix timestamp updates in CB_GETATTR
      vfs: remove inode_set_ctime_deleg()

 fs/attr.c           | 34 ++++++++++---------------
 fs/inode.c          | 73 -----------------------------------------------------
 fs/nfsd/nfs4proc.c  | 31 ++++++++++++++++++++++-
 fs/nfsd/nfs4state.c | 44 +++++++++++++++++---------------
 fs/nfsd/nfs4xdr.c   |  5 ++--
 fs/nfsd/state.h     |  8 ++++++
 fs/nfsd/vfs.c       |  2 +-
 include/linux/fs.h  |  3 +--
 8 files changed, 79 insertions(+), 121 deletions(-)
---
base-commit: b05f077b59098b4760e3f675b00a4e6a1ad4b0ad
change-id: 20250722-nfsd-testing-5e861a3cf3a0

Best regards,
-- 
Jeff Layton <jlayton@...nel.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ