summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2012-07-30 16:52:06 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-07-30 16:52:06 -0400
commit129ee840ba66e4b583f7bd0629e145117cb37638 (patch)
treeb563a78f80a72e267dd408f5640fb088740bb133
parentf42e88348aa3e9298fc38719202984ebd0e74a66 (diff)
downloadlongterm-queue-2.6.34-129ee840ba66e4b583f7bd0629e145117cb37638.tar.gz
add fix fcntl setlease patch
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--queue/locks-fix-checking-of-fcntl_setlease-argument.patch54
-rw-r--r--queue/series1
2 files changed, 55 insertions, 0 deletions
diff --git a/queue/locks-fix-checking-of-fcntl_setlease-argument.patch b/queue/locks-fix-checking-of-fcntl_setlease-argument.patch
new file mode 100644
index 0000000..f23a8a1
--- /dev/null
+++ b/queue/locks-fix-checking-of-fcntl_setlease-argument.patch
@@ -0,0 +1,54 @@
+From e241217c6304888cbc393b3e9ceb087f477c82ba Mon Sep 17 00:00:00 2001
+From: "J. Bruce Fields" <bfields@fieldses.org>
+Date: Mon, 23 Jul 2012 15:17:17 -0400
+Subject: [PATCH] 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>
+
+diff --git a/fs/locks.c b/fs/locks.c
+index ab24d49..8cedfbf 100644
+--- a/fs/locks.c
++++ b/fs/locks.c
+@@ -291,7 +291,7 @@ static int flock_make_lock(struct file *filp, struct file_lock **lock,
+ return 0;
+ }
+
+-static int assign_type(struct file_lock *fl, int type)
++static int assign_type(struct file_lock *fl, long type)
+ {
+ switch (type) {
+ case F_RDLCK:
+@@ -444,7 +444,7 @@ static const struct lock_manager_operations lease_manager_ops = {
+ /*
+ * Initialize a lease, use the default lock manager operations
+ */
+-static int lease_init(struct file *filp, int type, struct file_lock *fl)
++static int lease_init(struct file *filp, long type, struct file_lock *fl)
+ {
+ if (assign_type(fl, type) != 0)
+ return -EINVAL;
+@@ -462,7 +462,7 @@ static int lease_init(struct file *filp, int type, struct file_lock *fl)
+ }
+
+ /* Allocate a file_lock initialised to this type of lease */
+-static struct file_lock *lease_alloc(struct file *filp, int type)
++static struct file_lock *lease_alloc(struct file *filp, long type)
+ {
+ struct file_lock *fl = locks_alloc_lock();
+ int error = -ENOMEM;
+--
+1.7.11.1
+
diff --git a/queue/series b/queue/series
index 10ea43f..4b03111 100644
--- a/queue/series
+++ b/queue/series
@@ -17,3 +17,4 @@ KVM-Ensure-all-vcpus-are-consistent-with-in-kernel-i.patch
security-fix-compile-error-in-commoncap.c.patch
fcaps-clear-the-same-personality-flags-as-suid-when-.patch
KEYS-Fix-a-NULL-pointer-deref-in-the-user-defined-ke.patch
+locks-fix-checking-of-fcntl_setlease-argument.patch