]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lockd: set file_lock start and end when decoding nlm4 testargs
authorJeff Layton <jlayton@kernel.org>
Tue, 14 Mar 2023 10:20:58 +0000 (06:20 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Mar 2023 10:49:23 +0000 (12:49 +0200)
commit41a68444e562dd7f793b056c9d51a06b4419097f
treee4e258528641e4f3f3018de39a8a24e19082dc4c
parent260becc3891ac69540f0d50a98d371587308144c
lockd: set file_lock start and end when decoding nlm4 testargs

commit 7ff84910c66c9144cc0de9d9deed9fb84c03aff0 upstream.

Commit 6930bcbfb6ce dropped the setting of the file_lock range when
decoding a nlm_lock off the wire. This causes the client side grant
callback to miss matching blocks and reject the lock, only to rerequest
it 30s later.

Add a helper function to set the file_lock range from the start and end
values that the protocol uses, and have the nlm_lock decoder call that to
set up the file_lock args properly.

Fixes: 6930bcbfb6ce ("lockd: detect and reject lock arguments that overflow")
Reported-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Amir Goldstein <amir73il@gmail.com>
Cc: stable@vger.kernel.org #6.0
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/lockd/clnt4xdr.c
fs/lockd/xdr4.c
include/linux/lockd/xdr4.h