Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc2f8021 authored by Jeff Layton's avatar Jeff Layton Committed by Greg Kroah-Hartman
Browse files

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: 94073ad7 (fs/locks: don't mess with the address limit in compat_fcntl64)
Reported-by: default avatarVitaly Lipatov <lav@etersoft.ru>
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4b575421
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -215,7 +215,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t;

#define COMPAT_OFF_T_MAX	0x7fffffff
#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL

/*
 * A pointer passed in from user mode. This should not
+0 −1
Original line number Diff line number Diff line
@@ -200,7 +200,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t;

#define COMPAT_OFF_T_MAX	0x7fffffff
#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL

/*
 * A pointer passed in from user mode. This should not
+0 −1
Original line number Diff line number Diff line
@@ -195,7 +195,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t;

#define COMPAT_OFF_T_MAX	0x7fffffff
#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL

struct compat_ipc64_perm {
	compat_key_t key;
+0 −1
Original line number Diff line number Diff line
@@ -185,7 +185,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t;

#define COMPAT_OFF_T_MAX	0x7fffffff
#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL

/*
 * A pointer passed in from user mode. This should not
+0 −1
Original line number Diff line number Diff line
@@ -263,7 +263,6 @@ typedef struct compat_siginfo {
#define si_overrun	_sifields._timer._overrun

#define COMPAT_OFF_T_MAX	0x7fffffff
#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL

/*
 * A pointer passed in from user mode. This should not
Loading