]> git.baikalelectronics.ru Git - kernel.git/commit
NLM: Defend against file_lock changes after vfs_test_lock()
authorBenjamin Coddington <bcodding@redhat.com>
Mon, 13 Jun 2022 13:40:06 +0000 (09:40 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Sat, 30 Jul 2022 00:08:56 +0000 (20:08 -0400)
commit7db45fc9831578ba68a83a99c62467fcee7b2e9b
tree5c26908a40480fae4d402c57ef1720dadf1e6532
parent6b5e749304b2eeeee57485c0afd80ead03e75184
NLM: Defend against file_lock changes after vfs_test_lock()

Instead of trusting that struct file_lock returns completely unchanged
after vfs_test_lock() when there's no conflicting lock, stash away our
nlm_lockowner reference so we can properly release it for all cases.

This defends against another file_lock implementation overwriting fl_owner
when the return type is F_UNLCK.

Reported-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
Tested-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svc4proc.c
fs/lockd/svclock.c
fs/lockd/svcproc.c
include/linux/lockd/lockd.h