fcntl: don't cap l_start and l_end values for F_GETLK64 in compat syscall
authorJeff Layton <jlayton@redhat.com>
Tue, 14 Nov 2017 19:42:57 +0000 (14:42 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Dec 2017 14:07:59 +0000 (15:07 +0100)
commitfc2f802193ccecf710ab608712b5b102dd9efc75
tree82cc9a30c45bbfe64f58b4b0476468eac5427a39
parent4b57542126669a5ad8bede61c8e9e07a5fc4a39b
fcntl: don't cap l_start and l_end values for F_GETLK64 in compat syscall

commit 4d2dc2cc766c3b51929658cacbc6e34fc8e242fb upstream.

Currently, we're capping the values too low in the F_GETLK64 case. The
fields in that structure are 64-bit values, so we shouldn't need to do
any sort of fixup there.

Make sure we check that assumption at build time in the future however
by ensuring that the sizes we're copying will fit.

With this, we no longer need COMPAT_LOFF_T_MAX either, so remove it.

Fixes: 94073ad77fff2 (fs/locks: don't mess with the address limit in compat_fcntl64)
Reported-by: Vitaly Lipatov <lav@etersoft.ru>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/compat.h
arch/mips/include/asm/compat.h
arch/parisc/include/asm/compat.h
arch/powerpc/include/asm/compat.h
arch/s390/include/asm/compat.h
arch/sparc/include/asm/compat.h
arch/tile/include/asm/compat.h
arch/x86/include/asm/compat.h
fs/fcntl.c