]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nfs4: have do_vfs_lock take an inode pointer
authorJeff Layton <jeff.layton@primarydata.com>
Sat, 11 Jul 2015 10:43:03 +0000 (06:43 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Oct 2015 00:52:00 +0000 (09:52 +0900)
commit41c4e0825b9d43a5d43a90c050ac9de4387865ba
treeb688d65692aa9944a319d8523dd9ec6359a7802a
parentc7fc0d83869f71e89bdc7cb4ee65ff02ac66159f
nfs4: have do_vfs_lock take an inode pointer

commit 83bfff23e9ed19f37c4ef0bba84e75bd88e5cf21 upstream.

Now that we have file locking helpers that can deal with an inode
instead of a filp, we can change the NFSv4 locking code to use that
instead.

This should fix the case where we have a filp that is closed while flock
or OFD locks are set on it, and the task is signaled so that it doesn't
wait for the LOCKU reply to come in before the filp is freed. At that
point we can end up with a use-after-free with the current code, which
relies on dereferencing the fl_file in the lock request.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Reviewed-by: "J. Bruce Fields" <bfields@fieldses.org>
Tested-by: "J. Bruce Fields" <bfields@fieldses.org>
Cc: William Dauchy <william@gandi.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c