NFS server allows a process to lock a file while it's already locked by another process.

  • 3181917
  • 04-Mar-2008
  • 30-Apr-2012

Environment

Novell SUSE Linux Enterprise Server 9 Support Pack 4
Novell Open Enterprise Server 1 (OES 1) Support Pack 2 Linux
Novell Linux Desktop 9

Situation

In some circumstances the kernel-based NFS server allows a process to get a lock on a file while the same file is locked by another process.

Resolution

The problem is reported to engineering and a fix is expected to be released with the coming kernel update.

Status

Reported to Engineering

Additional Information

Author: J. Bruce Fields
Currently when lockd gets an NLM_CANCEL request, it also does an unlock for the same range. This is incorrect.
The Open Group documentation says that "This procedure cancels an *outstanding* blocked lock request." (Emphasis mine.)
Also, consider a client that holds a lock on the first byte of a file, and requests a lock on the entire file. If the client cancels that request (perhaps because the requesting process is signaled), the server shouldn't apply perform an unlock on the entire file, since that will also remove the previous lock that the client was already granted.
Or consider a lock request that actually *downgraded* an exclusive lock to a shared lock.