diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0064-locks-fix-checking-of-fcntl_setlease-argument.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0064-locks-fix-checking-of-fcntl_setlease-argument.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0064-locks-fix-checking-of-fcntl_setlease-argument.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0064-locks-fix-checking-of-fcntl_setlease-argument.patch new file mode 100644 index 00000000..7296221e --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0064-locks-fix-checking-of-fcntl_setlease-argument.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From fb13198419fd31d8cbe249d285abd4f69d2c4f6d Mon Sep 17 00:00:00 2001 | ||
2 | From: "J. Bruce Fields" <bfields@fieldses.org> | ||
3 | Date: Mon, 23 Jul 2012 15:17:17 -0400 | ||
4 | Subject: [PATCH 64/73] locks: fix checking of fcntl_setlease argument | ||
5 | |||
6 | commit 0ec4f431eb56d633da3a55da67d5c4b88886ccc7 upstream. | ||
7 | |||
8 | The only checks of the long argument passed to fcntl(fd,F_SETLEASE,.) | ||
9 | are done after converting the long to an int. Thus some illegal values | ||
10 | may be let through and cause problems in later code. | ||
11 | |||
12 | [ They actually *don't* cause problems in mainline, as of Dave Jones's | ||
13 | commit 8d657eb3b438 "Remove easily user-triggerable BUG from | ||
14 | generic_setlease", but we should fix this anyway. And this patch will | ||
15 | be necessary to fix real bugs on earlier kernels. ] | ||
16 | |||
17 | Signed-off-by: J. Bruce Fields <bfields@redhat.com> | ||
18 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
19 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
20 | --- | ||
21 | fs/locks.c | 6 +++--- | ||
22 | 1 files changed, 3 insertions(+), 3 deletions(-) | ||
23 | |||
24 | diff --git a/fs/locks.c b/fs/locks.c | ||
25 | index 6a64f15..fcc50ab 100644 | ||
26 | --- a/fs/locks.c | ||
27 | +++ b/fs/locks.c | ||
28 | @@ -308,7 +308,7 @@ static int flock_make_lock(struct file *filp, struct file_lock **lock, | ||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | -static int assign_type(struct file_lock *fl, int type) | ||
33 | +static int assign_type(struct file_lock *fl, long type) | ||
34 | { | ||
35 | switch (type) { | ||
36 | case F_RDLCK: | ||
37 | @@ -445,7 +445,7 @@ static const struct lock_manager_operations lease_manager_ops = { | ||
38 | /* | ||
39 | * Initialize a lease, use the default lock manager operations | ||
40 | */ | ||
41 | -static int lease_init(struct file *filp, int type, struct file_lock *fl) | ||
42 | +static int lease_init(struct file *filp, long type, struct file_lock *fl) | ||
43 | { | ||
44 | if (assign_type(fl, type) != 0) | ||
45 | return -EINVAL; | ||
46 | @@ -463,7 +463,7 @@ static int lease_init(struct file *filp, int type, struct file_lock *fl) | ||
47 | } | ||
48 | |||
49 | /* Allocate a file_lock initialised to this type of lease */ | ||
50 | -static struct file_lock *lease_alloc(struct file *filp, int type) | ||
51 | +static struct file_lock *lease_alloc(struct file *filp, long type) | ||
52 | { | ||
53 | struct file_lock *fl = locks_alloc_lock(); | ||
54 | int error = -ENOMEM; | ||
55 | -- | ||
56 | 1.7.7.6 | ||
57 | |||