Commit 5a3e0b19 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'locks-v4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux

Pull file locking update from Jeff Layton:
 "A couple of fixes for a patch that went into v4.14, and the bug report
  just came in a few days ago.. It passes my (minimal) testing, and has
  been in linux-next for a few days now.

  I also would like to get my address changed in MAINTAINERS to clear
  that hurdle"

* tag 'locks-v4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
  fcntl: don't cap l_start and l_end values for F_GETLK64 in compat syscall
  fcntl: don't leak fd reference when fixup_compat_flock fails
  MAINTAINERS: s/jlayton@poochiereds.net/jlayton@kernel.org/
parents cbda1b27 4d2dc2cc
...@@ -5216,7 +5216,7 @@ F: drivers/video/fbdev/s1d13xxxfb.c ...@@ -5216,7 +5216,7 @@ F: drivers/video/fbdev/s1d13xxxfb.c
F: include/video/s1d13xxxfb.h F: include/video/s1d13xxxfb.h
ERRSEQ ERROR TRACKING INFRASTRUCTURE ERRSEQ ERROR TRACKING INFRASTRUCTURE
M: Jeff Layton <jlayton@poochiereds.net> M: Jeff Layton <jlayton@kernel.org>
S: Maintained S: Maintained
F: lib/errseq.c F: lib/errseq.c
F: include/linux/errseq.h F: include/linux/errseq.h
...@@ -5404,7 +5404,7 @@ F: include/scsi/libfcoe.h ...@@ -5404,7 +5404,7 @@ F: include/scsi/libfcoe.h
F: include/uapi/scsi/fc/ F: include/uapi/scsi/fc/
FILE LOCKING (flock() and fcntl()/lockf()) FILE LOCKING (flock() and fcntl()/lockf())
M: Jeff Layton <jlayton@poochiereds.net> M: Jeff Layton <jlayton@kernel.org>
M: "J. Bruce Fields" <bfields@fieldses.org> M: "J. Bruce Fields" <bfields@fieldses.org>
L: linux-fsdevel@vger.kernel.org L: linux-fsdevel@vger.kernel.org
S: Maintained S: Maintained
...@@ -7550,7 +7550,7 @@ S: Odd Fixes ...@@ -7550,7 +7550,7 @@ S: Odd Fixes
KERNEL NFSD, SUNRPC, AND LOCKD SERVERS KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
M: "J. Bruce Fields" <bfields@fieldses.org> M: "J. Bruce Fields" <bfields@fieldses.org>
M: Jeff Layton <jlayton@poochiereds.net> M: Jeff Layton <jlayton@kernel.org>
L: linux-nfs@vger.kernel.org L: linux-nfs@vger.kernel.org
W: http://nfs.sourceforge.net/ W: http://nfs.sourceforge.net/
T: git git://linux-nfs.org/~bfields/linux.git T: git git://linux-nfs.org/~bfields/linux.git
......
...@@ -215,7 +215,6 @@ typedef struct compat_siginfo { ...@@ -215,7 +215,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t; } compat_siginfo_t;
#define COMPAT_OFF_T_MAX 0x7fffffff #define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
/* /*
* A pointer passed in from user mode. This should not * A pointer passed in from user mode. This should not
......
...@@ -200,7 +200,6 @@ typedef struct compat_siginfo { ...@@ -200,7 +200,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t; } compat_siginfo_t;
#define COMPAT_OFF_T_MAX 0x7fffffff #define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
/* /*
* A pointer passed in from user mode. This should not * A pointer passed in from user mode. This should not
......
...@@ -195,7 +195,6 @@ typedef struct compat_siginfo { ...@@ -195,7 +195,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t; } compat_siginfo_t;
#define COMPAT_OFF_T_MAX 0x7fffffff #define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
struct compat_ipc64_perm { struct compat_ipc64_perm {
compat_key_t key; compat_key_t key;
......
...@@ -185,7 +185,6 @@ typedef struct compat_siginfo { ...@@ -185,7 +185,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t; } compat_siginfo_t;
#define COMPAT_OFF_T_MAX 0x7fffffff #define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
/* /*
* A pointer passed in from user mode. This should not * A pointer passed in from user mode. This should not
......
...@@ -263,7 +263,6 @@ typedef struct compat_siginfo { ...@@ -263,7 +263,6 @@ typedef struct compat_siginfo {
#define si_overrun _sifields._timer._overrun #define si_overrun _sifields._timer._overrun
#define COMPAT_OFF_T_MAX 0x7fffffff #define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
/* /*
* A pointer passed in from user mode. This should not * A pointer passed in from user mode. This should not
......
...@@ -209,7 +209,6 @@ typedef struct compat_siginfo { ...@@ -209,7 +209,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t; } compat_siginfo_t;
#define COMPAT_OFF_T_MAX 0x7fffffff #define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
/* /*
* A pointer passed in from user mode. This should not * A pointer passed in from user mode. This should not
......
...@@ -173,7 +173,6 @@ typedef struct compat_siginfo { ...@@ -173,7 +173,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t; } compat_siginfo_t;
#define COMPAT_OFF_T_MAX 0x7fffffff #define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
struct compat_ipc64_perm { struct compat_ipc64_perm {
compat_key_t key; compat_key_t key;
......
...@@ -210,7 +210,6 @@ typedef struct compat_siginfo { ...@@ -210,7 +210,6 @@ typedef struct compat_siginfo {
} compat_siginfo_t; } compat_siginfo_t;
#define COMPAT_OFF_T_MAX 0x7fffffff #define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
struct compat_ipc64_perm { struct compat_ipc64_perm {
compat_key_t key; compat_key_t key;
......
...@@ -563,6 +563,9 @@ static int put_compat_flock64(const struct flock *kfl, struct compat_flock64 __u ...@@ -563,6 +563,9 @@ static int put_compat_flock64(const struct flock *kfl, struct compat_flock64 __u
{ {
struct compat_flock64 fl; struct compat_flock64 fl;
BUILD_BUG_ON(sizeof(kfl->l_start) > sizeof(ufl->l_start));
BUILD_BUG_ON(sizeof(kfl->l_len) > sizeof(ufl->l_len));
memset(&fl, 0, sizeof(struct compat_flock64)); memset(&fl, 0, sizeof(struct compat_flock64));
copy_flock_fields(&fl, kfl); copy_flock_fields(&fl, kfl);
if (copy_to_user(ufl, &fl, sizeof(struct compat_flock64))) if (copy_to_user(ufl, &fl, sizeof(struct compat_flock64)))
...@@ -632,9 +635,8 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, ...@@ -632,9 +635,8 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
if (err) if (err)
break; break;
err = fixup_compat_flock(&flock); err = fixup_compat_flock(&flock);
if (err) if (!err)
return err; err = put_compat_flock(&flock, compat_ptr(arg));
err = put_compat_flock(&flock, compat_ptr(arg));
break; break;
case F_GETLK64: case F_GETLK64:
case F_OFD_GETLK: case F_OFD_GETLK:
...@@ -642,12 +644,8 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, ...@@ -642,12 +644,8 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
if (err) if (err)
break; break;
err = fcntl_getlk(f.file, convert_fcntl_cmd(cmd), &flock); err = fcntl_getlk(f.file, convert_fcntl_cmd(cmd), &flock);
if (err) if (!err)
break; err = put_compat_flock64(&flock, compat_ptr(arg));
err = fixup_compat_flock(&flock);
if (err)
return err;
err = put_compat_flock64(&flock, compat_ptr(arg));
break; break;
case F_SETLK: case F_SETLK:
case F_SETLKW: case F_SETLKW:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment