]> git.baikalelectronics.ru Git - kernel.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)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 23 Jul 2012 19:46:01 +0000 (12:46 -0700)
commit6dd58b086f9d96b05f6631bd6e181e2090248595
tree7a782163f6598510ae57b0523c2e625a8b26f2ce
parent9cf99f0e79476a32a516713443ef2ee61c686a49
locks: fix checking of fcntl_setlease argument

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 0a3f25b743cc "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. ]

Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/locks.c