]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
lockd: Fix invalid lockowner cast after vfs_test_lock
authorBenjamin Coddington <bcodding@redhat.com>
Mon, 26 Jul 2021 13:33:28 +0000 (09:33 -0400)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 11 Oct 2021 23:08:49 +0000 (17:08 -0600)
commit50a53541305be5698e9b3fedb0ac88d94f3d7ed3
tree26a77e6c93d12c88848c8b3b687b87a9b23cffb0
parent4472be20301bb89f019940345db1d6acce05c84c
lockd: Fix invalid lockowner cast after vfs_test_lock

BugLink: https://bugs.launchpad.net/bugs/1946024
[ Upstream commit cd2d644ddba183ec7b451b7c20d5c7cc06fcf0d7 ]

After calling vfs_test_lock() the pointer to a conflicting lock can be
returned, and that lock is not guarunteed to be owned by nlm.  In that
case, we cannot cast it to struct nlm_lockowner.  Instead return the pid
of that conflicting lock.

Fixes: 646d73e91b42 ("lockd: Show pid of lockd for remote locks")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/lockd/svclock.c