]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFSv4: Handle the special Linux file open access mode
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 27 Jun 2019 10:41:45 +0000 (06:41 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:12:58 +0000 (09:12 +0200)
commitb3dd02f968711844b132a1db7e46df8a2a660489
tree57b15ba3899ff4a8eb56766a60dc8a1d200311af
parent5c48d5d4e5f9ad8cceca84a1a2445a0e46eba47c
NFSv4: Handle the special Linux file open access mode

commit 44942b4e457beda00981f616402a1a791e8c616e upstream.

According to the open() manpage, Linux reserves the access mode 3
to mean "check for read and write permission on the file and return
a file descriptor that can't be used for reading or writing."

Currently, the NFSv4 code will ask the server to open the file,
and will use an incorrect share access mode of 0. Since it has
an incorrect share access mode, the client later forgets to send
a corresponding close, meaning it can leak stateids on the server.

Fixes: ce4ef7c0a8a05 ("NFS: Split out NFS v4 file operations")
Cc: stable@vger.kernel.org # 3.6+
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/inode.c
fs/nfs/nfs4file.c