]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfsd: Always lock state exclusively.
authorOleg Drokin <green@linuxhacker.ru>
Wed, 15 Jun 2016 03:28:04 +0000 (23:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jul 2016 15:42:11 +0000 (08:42 -0700)
commit9c37c2aec4f0c7c450aa3f92cc0356698bde8c68
tree8d526e1b7dc8edb4ba819f966547d5c9620106fe
parent2de09ffe78ed319167f329f79dcefae32221fd55
nfsd: Always lock state exclusively.

commit feb9dad5209280085d5b0c094fa67e7a8d75c81a upstream.

It used to be the case that state had an rwlock that was locked for write
by downgrades, but for read for upgrades (opens). Well, the problem is
if there are two competing opens for the same state, they step on
each other toes potentially leading to leaking file descriptors
from the state structure, since access mode is a bitmap only set once.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4state.c
fs/nfsd/state.h