]> git.karo-electronics.de Git - karo-tx-linux.git/commit
locks: fix checking of fcntl_setlease argument
authorJ. Bruce Fields <bfields@fieldses.org>
Mon, 23 Jul 2012 19:17:17 +0000 (15:17 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 17 Aug 2012 19:35:06 +0000 (15:35 -0400)
commit7e8b079eed559b42a1b99f9c64b210296d6a815b
tree948c684357cec213d491d3605385d5a87ffae64d
parent7a38cd5587a22afeb4da5a1e626a47e317b38e95
locks: fix checking of fcntl_setlease argument

commit 0ec4f431eb56d633da3a55da67d5c4b88886ccc7 upstream.

The only checks of the long argument passed to fcntl(fd,F_SETLEASE,.)
are done after converting the long to an int.  Thus some illegal values
may be let through and cause problems in later code.

[ They actually *don't* cause problems in mainline, as of Dave Jones's
  commit 8d657eb3b438 "Remove easily user-triggerable BUG from
  generic_setlease", but we should fix this anyway.  And this patch will
  be necessary to fix real bugs on earlier kernels. ]

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
fs/locks.c