]> git.baikalelectronics.ru Git - kernel.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)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 6 Jul 2019 18:54:25 +0000 (14:54 -0400)
commit67b0be40acc0271acadb79e710a0b47c042c54c8
treee03203a21af986b172f18de134c4eab0cf1039c5
parentfcc76804c17e478000492833638c338c0f712cda
NFSv4: Handle the special Linux file open access mode

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: a90d5c4e65080 ("NFS: Split out NFS v4 file operations")
Cc: stable@vger.kernel.org # 3.6+
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/inode.c
fs/nfs/nfs4file.c