Skip to content

Commit

Permalink
Merge tag 'locks-v4.15-1' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/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/[email protected]/[email protected]/
  • Loading branch information
torvalds committed Nov 17, 2017
2 parents cbda1b2 + 4d2dc2c commit 5a3e0b1
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 20 deletions.
6 changes: 3 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5216,7 +5216,7 @@ F: drivers/video/fbdev/s1d13xxxfb.c
F: include/video/s1d13xxxfb.h

ERRSEQ ERROR TRACKING INFRASTRUCTURE
M: Jeff Layton <jlayton@poochiereds.net>
M: Jeff Layton <jlayton@kernel.org>
S: Maintained
F: lib/errseq.c
F: include/linux/errseq.h
Expand Down Expand Up @@ -5404,7 +5404,7 @@ F: include/scsi/libfcoe.h
F: include/uapi/scsi/fc/

FILE LOCKING (flock() and fcntl()/lockf())
M: Jeff Layton <jlayton@poochiereds.net>
M: Jeff Layton <jlayton@kernel.org>
M: "J. Bruce Fields" <[email protected]>
L: [email protected]
S: Maintained
Expand Down Expand Up @@ -7550,7 +7550,7 @@ S: Odd Fixes

KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
M: "J. Bruce Fields" <[email protected]>
M: Jeff Layton <jlayton@poochiereds.net>
M: Jeff Layton <jlayton@kernel.org>
L: [email protected]
W: http://nfs.sourceforge.net/
T: git git://linux-nfs.org/~bfields/linux.git
Expand Down
1 change: 0 additions & 1 deletion arch/arm64/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/mips/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/parisc/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/s390/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/sparc/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,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
Expand Down
1 change: 0 additions & 1 deletion arch/tile/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,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;
Expand Down
1 change: 0 additions & 1 deletion arch/x86/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,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;
Expand Down
16 changes: 7 additions & 9 deletions fs/fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,9 @@ static int put_compat_flock64(const struct flock *kfl, struct compat_flock64 __u
{
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));
copy_flock_fields(&fl, kfl);
if (copy_to_user(ufl, &fl, sizeof(struct compat_flock64)))
Expand Down Expand Up @@ -632,22 +635,17 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
if (err)
break;
err = fixup_compat_flock(&flock);
if (err)
return err;
err = put_compat_flock(&flock, compat_ptr(arg));
if (!err)
err = put_compat_flock(&flock, compat_ptr(arg));
break;
case F_GETLK64:
case F_OFD_GETLK:
err = get_compat_flock64(&flock, compat_ptr(arg));
if (err)
break;
err = fcntl_getlk(f.file, convert_fcntl_cmd(cmd), &flock);
if (err)
break;
err = fixup_compat_flock(&flock);
if (err)
return err;
err = put_compat_flock64(&flock, compat_ptr(arg));
if (!err)
err = put_compat_flock64(&flock, compat_ptr(arg));
break;
case F_SETLK:
case F_SETLKW:
Expand Down

0 comments on commit 5a3e0b1

Please sign in to comment.