OpenCloudOS-Kernel/include/linux/lockd
Jeff Layton 6930bcbfb6 lockd: detect and reject lock arguments that overflow
lockd doesn't currently vet the start and length in nlm4 requests like
it should, and can end up generating lock requests with arguments that
overflow when passed to the filesystem.

The NLM4 protocol uses unsigned 64-bit arguments for both start and
length, whereas struct file_lock tracks the start and end as loff_t
values. By the time we get around to calling nlm4svc_retrieve_args,
we've lost the information that would allow us to determine if there was
an overflow.

Start tracking the actual start and len for NLM4 requests in the
nlm_lock. In nlm4svc_retrieve_args, vet these values to ensure they
won't cause an overflow, and return NLM4_FBIG if they do.

Link: https://bugzilla.linux-nfs.org/show_bug.cgi?id=392
Reported-by: Jan Kasiak <j.kasiak@gmail.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: <stable@vger.kernel.org> # 5.14+
2022-08-04 10:28:48 -04:00
..
bind.h Keep read and write fds with each nlm_file 2021-08-23 18:05:31 -04:00
debug.h lockd: remove __KERNEL__ ifdefs 2019-11-12 11:43:29 -05:00
lockd.h NLM: Defend against file_lock changes after vfs_test_lock() 2022-07-29 20:08:56 -04:00
nlm.h
share.h
xdr.h lockd: detect and reject lock arguments that overflow 2022-08-04 10:28:48 -04:00
xdr4.h SUNRPC: Change return value type of .pc_encode 2021-10-13 11:34:49 -04:00