Skip to content

Commit 251af29

Browse files
trondmypdamschuma-ntap
authored andcommitted
nlm: Ensure callback code also checks that the files match
It is not sufficient to just check that the lock pids match when granting a callback, we also need to ensure that we're granting the callback on the right file. Reported-by: Pankaj Singh <psingh.ait@gmail.com> Fixes: 1da177e ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent b977b64 commit 251af29

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎include/linux/lockd/lockd.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ static inline int nlm_privileged_requester(const struct svc_rqst *rqstp)
355355
static inline int nlm_compare_locks(const struct file_lock *fl1,
356356
const struct file_lock *fl2)
357357
{
358-
return fl1->fl_pid == fl2->fl_pid
358+
return file_inode(fl1->fl_file) == file_inode(fl2->fl_file)
359+
&& fl1->fl_pid == fl2->fl_pid
359360
&& fl1->fl_owner == fl2->fl_owner
360361
&& fl1->fl_start == fl2->fl_start
361362
&& fl1->fl_end == fl2->fl_end

0 commit comments

Comments
 (0)