Commit 0bdb53e1 authored by Jeff Layton's avatar Jeff Layton Committed by Greg Kroah-Hartman
Browse files

locks: have flock_lock_file take an inode pointer instead of a filp



commit bcd7f78d upstream.

...and rename it to better describe how it works.

In order to fix a use-after-free in NFS, we need to be able to remove
locks from an inode after the filp associated with them may have already
been freed. flock_lock_file already only dereferences the filp to get to
the inode, so just change it so the callers do that.

All of the callers already pass in a lock request that has the fl_file
set properly, so we don't need to pass it in individually. With that
change it now only dereferences the filp to get to the inode, so just
push that out to the callers.

Signed-off-by: default avatarJeff Layton <jeff.layton@primarydata.com>
Reviewed-by: default avatar"J. Bruce Fields" <bfields@fieldses.org>
Tested-by: default avatar"J. Bruce Fields" <bfields@fieldses.org>
Cc: William Dauchy <william@gandi.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 23a0f8cd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment