OSDN Git Service

nfsd4: disallow ALLOCATE with special stateids
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 3 Apr 2015 20:24:27 +0000 (16:24 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:04:04 +0000 (22:04 +0200)
commit2556cb4a63a559a09112aba49d0112bd7dc4d2d6
tree86d4dca446a7fef98560d925100f733f82b76491
parent04dcce2b2b45c99fdaebd0baa19640674ea388f4
nfsd4: disallow ALLOCATE with special stateids

commit 5ba4a25ab7b13be528b23f85182f4d09cf7f71ad upstream.

vfs_fallocate will hit a NULL dereference if the client tries an
ALLOCATE or DEALLOCATE with a special stateid.  Fix that.  (We also
depend on the open to have broken any conflicting leases or delegations
for us.)

(If it turns out we need to allow special stateid's then we could do a
temporary open here in the special-stateid case, as we do for read and
write.  For now I'm assuming it's not necessary.)

Fixes: 95d871f03cae "nfsd: Add ALLOCATE support"
Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4proc.c