Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Oct 2021 23:46:59 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 259071] Read past EoF in NFS client and fusefs
Message-ID:  <bug-259071-227-66i9nmYIao@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-259071-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-259071-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259071

--- Comment #7 from Rick Macklem <rmacklem@FreeBSD.org> ---
Created attachment 229053
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D229053&action=
=3Dedit
timestamp file mods so Lookup can discard stale attributes against Writing

Similar to attachment #228973, I believe there could be a race between the =
NFS
client VOP_LOOKUP() and file Writing that could result in stale file
attributes being loaded into the NFS vnode by VOP_LOOKUP().

I have not been able to reproduce a failure due to this race, but
I believe that there are two possibilities:

The Lookup RPC happens while VOP_WRITE() is being executed and loads stale =
file
attributes after VOP_WRITE() returns when it has already completed the
Write/Commit RPC(s).=20
--> For this case, setting the local modify timestamp at the end of VOP_WRI=
TE()=20
    should ensure that stale file attributes are not loaded.

The Lookup RPC occurs after VOP_WRITE() has returned, while asynchronous=20
Write/Commit RPCs are in progress and then is blocked by the vnode held by
VOP_OPEN/VOP_CLOSE/VOP_FSYNC which will flush writes via ncl_flush() or
ncl_vinvalbuf(), clearing the NMODIFIED flag (which indicates
Writes-in-progress). The VOP_LOOKUP() then acquires the NFS vnode lock and
fills in stale file attributes.=20
--> Setting the local modify timestamp in ncl_flsuh() and ncl_vinvalbuf() w=
hen=20
    they clear NMODIFIED should ensure that stale file attributes are not=20
    loaded.

This patch does the above.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-259071-227-66i9nmYIao>