]> git.pld-linux.org Git - packages/kernel.git/blob - kernel-small_fixes.patch
- fix for http://seclists.org/bugtraq/2010/Oct/161
[packages/kernel.git] / kernel-small_fixes.patch
1 --- linux-2.6.15.6/drivers/input/joystick/iforce/iforce-serio.c 2006-03-05 19:07:54.000000000 +0000
2 +++ linux-2.6.15.6.iforce/drivers/input/joystick/iforce/iforce-serio.c  2006-04-29 23:17:59.000000000 +0000
3 @@ -175,6 +175,12 @@
4                 .id     = SERIO_ANY,
5                 .extra  = SERIO_ANY,
6         },
7 +       {
8 +               .type   = SERIO_RS232,
9 +               .proto  = 0x1f, // Trust ForceFeedback Race Master
10 +               .id     = SERIO_ANY,
11 +               .extra  = SERIO_ANY,
12 +       },
13         { 0 }
14  };
15  
16 --- linux-2.6.27/arch/powerpc/include/asm/io.h~ 2006-06-18 01:49:35.000000000 +0000
17 +++ linux-2.6.27/arch/powerpc/include/asm/io.h  2006-06-22 02:44:19.000000000 +0000
18 @@ -445,6 +445,10 @@
19  #define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)
20  #define page_to_bus(page)      (page_to_phys(page) + PCI_DRAM_OFFSET)
21  
22 +#define isa_virt_to_bus virt_to_phys
23 +#define isa_page_to_bus page_to_phys
24 +#define isa_bus_to_virt phys_to_virt
25 +
26  /* Enforce in-order execution of data I/O.
27   * No distinction between read/write on PPC; use eieio for all three.
28   */
29 --- linux-2.6.27/arch/powerpc/include/asm/suspend.h     2007-07-09 01:32:17.000000000 +0200
30 +++ linux-2.6.27/arch/powerpc/include/asm/suspend.h     2007-08-28 23:26:16.629658848 +0200
31 @@ -6,4 +6,7 @@
32  void save_processor_state(void);
33  void restore_processor_state(void);
34  
35 +#define suspend2_faulted (0)
36 +#define clear_suspend2_fault() do { } while(0)
37 +
38  #endif /* __ASM_POWERPC_SUSPEND_H */
39 --- linux-2.6.26/arch/powerpc/kernel/swsusp.c   2008-09-29 00:01:56.000000000 +0200
40 +++ linux-2.6.26/arch/powerpc/kernel/swsusp.c   2008-09-29 00:01:42.000000000 +0200
41 @@ -9,6 +9,7 @@
42   * 2 of the License, or (at your option) any later version.
43   */
44  
45 +#include <linux/module.h>
46  #include <linux/sched.h>
47  #include <asm/suspend.h>
48  #include <asm/system.h>
49 @@ -30,6 +31,7 @@
50  #endif
51  
52  }
53 +EXPORT_SYMBOL(save_processor_state);
54  
55  void restore_processor_state(void)
56  {
57
58 --- linux-2.6.32/drivers/infiniband/Kconfig~    2009-12-05 00:26:03.663774916 +0100
59 +++ linux-2.6.32/drivers/infiniband/Kconfig     2009-12-05 00:26:05.914179759 +0100
60 @@ -37,7 +37,6 @@
61  config INFINIBAND_ADDR_TRANS
62         bool
63         depends on INET
64 -       depends on !(INFINIBAND = y && IPV6 = m)
65         default y
66  
67  source "drivers/infiniband/hw/mthca/Kconfig"
68 --- linux-2.6.33/scripts/mod/modpost.c~ 2010-02-24 19:52:17.000000000 +0100
69 +++ linux-2.6.33/scripts/mod/modpost.c  2010-03-07 14:26:47.242168558 +0100
70 @@ -15,7 +15,8 @@
71  #include <stdio.h>
72  #include <ctype.h>
73  #include "modpost.h"
74 -#include "../../include/generated/autoconf.h"
75 +// PLD architectures don't use CONFIG_SYMBOL_PREFIX
76 +//#include "../../include/generated/autoconf.h"
77  #include "../../include/linux/license.h"
78  
79  /* Some toolchains use a `_' prefix for all user symbols. */
80 From 799c10559d60f159ab2232203f222f18fa3c4a5f Mon Sep 17 00:00:00 2001
81 From: Linus Torvalds <torvalds@linux-foundation.org>
82 Date: Fri, 15 Oct 2010 11:09:28 -0700
83 Subject: [PATCH] De-pessimize rds_page_copy_user
84
85 Don't try to "optimize" rds_page_copy_user() by using kmap_atomic() and
86 the unsafe atomic user mode accessor functions.  It's actually slower
87 than the straightforward code on any reasonable modern CPU.
88
89 Back when the code was written (although probably not by the time it was
90 actually merged, though), 32-bit x86 may have been the dominant
91 architecture.  And there kmap_atomic() can be a lot faster than kmap()
92 (unless you have very good locality, in which case the virtual address
93 caching by kmap() can overcome all the downsides).
94
95 But these days, x86-64 may not be more populous, but it's getting there
96 (and if you care about performance, it's definitely already there -
97 you'd have upgraded your CPU's already in the last few years).  And on
98 x86-64, the non-kmap_atomic() version is faster, simply because the code
99 is simpler and doesn't have the "re-try page fault" case.
100
101 People with old hardware are not likely to care about RDS anyway, and
102 the optimization for the 32-bit case is simply buggy, since it doesn't
103 verify the user addresses properly.
104
105 Reported-by: Dan Rosenberg <drosenberg@vsecurity.com>
106 Acked-by: Andrew Morton <akpm@linux-foundation.org>
107 Cc: stable@kernel.org
108 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
109 ---
110  net/rds/page.c |   27 +++++++--------------------
111  1 files changed, 7 insertions(+), 20 deletions(-)
112
113 diff --git a/net/rds/page.c b/net/rds/page.c
114 index 595a952..1dfbfea 100644
115 --- a/net/rds/page.c
116 +++ b/net/rds/page.c
117 @@ -57,30 +57,17 @@ int rds_page_copy_user(struct page *page, unsigned long offset,
118         unsigned long ret;
119         void *addr;
120  
121 -       if (to_user)
122 +       addr = kmap(page);
123 +       if (to_user) {
124                 rds_stats_add(s_copy_to_user, bytes);
125 -       else
126 +               ret = copy_to_user(ptr, addr + offset, bytes);
127 +       } else {
128                 rds_stats_add(s_copy_from_user, bytes);
129 -
130 -       addr = kmap_atomic(page, KM_USER0);
131 -       if (to_user)
132 -               ret = __copy_to_user_inatomic(ptr, addr + offset, bytes);
133 -       else
134 -               ret = __copy_from_user_inatomic(addr + offset, ptr, bytes);
135 -       kunmap_atomic(addr, KM_USER0);
136 -
137 -       if (ret) {
138 -               addr = kmap(page);
139 -               if (to_user)
140 -                       ret = copy_to_user(ptr, addr + offset, bytes);
141 -               else
142 -                       ret = copy_from_user(addr + offset, ptr, bytes);
143 -               kunmap(page);
144 -               if (ret)
145 -                       return -EFAULT;
146 +               ret = copy_from_user(addr + offset, ptr, bytes);
147         }
148 +       kunmap(page);
149  
150 -       return 0;
151 +       return ret ? -EFAULT : 0;
152  }
153  EXPORT_SYMBOL_GPL(rds_page_copy_user);
154  
155 -- 
156 1.7.3.1
157
This page took 0.053016 seconds and 4 git commands to generate.