Annotation of /trunk/kernel26-alx/patches-2.6.27-r3/0153-2.6.27.54-all-fixes.patch
Parent Directory | Revision Log
Revision 1176 -
(hide annotations)
(download)
Thu Oct 14 15:11:06 2010 UTC (13 years, 11 months ago) by niro
File size: 12262 byte(s)
Thu Oct 14 15:11:06 2010 UTC (13 years, 11 months ago) by niro
File size: 12262 byte(s)
-2.6.27-alx-r3: new magellan 0.5.2 kernel
1 | niro | 1176 | diff --git a/arch/ia64/include/asm/compat.h b/arch/ia64/include/asm/compat.h |
2 | index dfcf75b..c8662cd 100644 | ||
3 | --- a/arch/ia64/include/asm/compat.h | ||
4 | +++ b/arch/ia64/include/asm/compat.h | ||
5 | @@ -198,7 +198,7 @@ ptr_to_compat(void __user *uptr) | ||
6 | } | ||
7 | |||
8 | static __inline__ void __user * | ||
9 | -compat_alloc_user_space (long len) | ||
10 | +arch_compat_alloc_user_space (long len) | ||
11 | { | ||
12 | struct pt_regs *regs = task_pt_regs(current); | ||
13 | return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len); | ||
14 | diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h | ||
15 | index 4774c2f..8d0fff3 100644 | ||
16 | --- a/arch/powerpc/include/asm/compat.h | ||
17 | +++ b/arch/powerpc/include/asm/compat.h | ||
18 | @@ -133,7 +133,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) | ||
19 | return (u32)(unsigned long)uptr; | ||
20 | } | ||
21 | |||
22 | -static inline void __user *compat_alloc_user_space(long len) | ||
23 | +static inline void __user *arch_compat_alloc_user_space(long len) | ||
24 | { | ||
25 | struct pt_regs *regs = current->thread.regs; | ||
26 | unsigned long usp = regs->gpr[1]; | ||
27 | diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h | ||
28 | index de065b3..307cac1 100644 | ||
29 | --- a/arch/s390/include/asm/compat.h | ||
30 | +++ b/arch/s390/include/asm/compat.h | ||
31 | @@ -163,7 +163,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) | ||
32 | return (u32)(unsigned long)uptr; | ||
33 | } | ||
34 | |||
35 | -static inline void __user *compat_alloc_user_space(long len) | ||
36 | +static inline void __user *arch_compat_alloc_user_space(long len) | ||
37 | { | ||
38 | unsigned long stack; | ||
39 | |||
40 | diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h | ||
41 | index 0e70625..612bb38 100644 | ||
42 | --- a/arch/sparc/include/asm/compat.h | ||
43 | +++ b/arch/sparc/include/asm/compat.h | ||
44 | @@ -166,7 +166,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) | ||
45 | return (u32)(unsigned long)uptr; | ||
46 | } | ||
47 | |||
48 | -static inline void __user *compat_alloc_user_space(long len) | ||
49 | +static inline void __user *arch_compat_alloc_user_space(long len) | ||
50 | { | ||
51 | struct pt_regs *regs = current_thread_info()->kregs; | ||
52 | unsigned long usp = regs->u_regs[UREG_I6]; | ||
53 | diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S | ||
54 | index 5d7f4af..745bab2 100644 | ||
55 | --- a/arch/x86/ia32/ia32entry.S | ||
56 | +++ b/arch/x86/ia32/ia32entry.S | ||
57 | @@ -50,7 +50,12 @@ | ||
58 | /* | ||
59 | * Reload arg registers from stack in case ptrace changed them. | ||
60 | * We don't reload %eax because syscall_trace_enter() returned | ||
61 | - * the value it wants us to use in the table lookup. | ||
62 | + * the %rax value we should see. Instead, we just truncate that | ||
63 | + * value to 32 bits again as we did on entry from user mode. | ||
64 | + * If it's a new value set by user_regset during entry tracing, | ||
65 | + * this matches the normal truncation of the user-mode value. | ||
66 | + * If it's -1 to make us punt the syscall, then (u32)-1 is still | ||
67 | + * an appropriately invalid value. | ||
68 | */ | ||
69 | .macro LOAD_ARGS32 offset, _r9=0 | ||
70 | .if \_r9 | ||
71 | @@ -60,6 +65,7 @@ | ||
72 | movl \offset+48(%rsp),%edx | ||
73 | movl \offset+56(%rsp),%esi | ||
74 | movl \offset+64(%rsp),%edi | ||
75 | + movl %eax,%eax /* zero extension */ | ||
76 | .endm | ||
77 | |||
78 | .macro CFI_STARTPROC32 simple | ||
79 | @@ -153,7 +159,7 @@ ENTRY(ia32_sysenter_target) | ||
80 | testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10) | ||
81 | CFI_REMEMBER_STATE | ||
82 | jnz sysenter_tracesys | ||
83 | - cmpl $(IA32_NR_syscalls-1),%eax | ||
84 | + cmpq $(IA32_NR_syscalls-1),%rax | ||
85 | ja ia32_badsys | ||
86 | sysenter_do_call: | ||
87 | IA32_ARG_FIXUP | ||
88 | @@ -195,7 +201,7 @@ sysexit_from_sys_call: | ||
89 | movl $AUDIT_ARCH_I386,%edi /* 1st arg: audit arch */ | ||
90 | call audit_syscall_entry | ||
91 | movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */ | ||
92 | - cmpl $(IA32_NR_syscalls-1),%eax | ||
93 | + cmpq $(IA32_NR_syscalls-1),%rax | ||
94 | ja ia32_badsys | ||
95 | movl %ebx,%edi /* reload 1st syscall arg */ | ||
96 | movl RCX-ARGOFFSET(%rsp),%esi /* reload 2nd syscall arg */ | ||
97 | @@ -248,7 +254,7 @@ sysenter_tracesys: | ||
98 | call syscall_trace_enter | ||
99 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ | ||
100 | RESTORE_REST | ||
101 | - cmpl $(IA32_NR_syscalls-1),%eax | ||
102 | + cmpq $(IA32_NR_syscalls-1),%rax | ||
103 | ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */ | ||
104 | jmp sysenter_do_call | ||
105 | CFI_ENDPROC | ||
106 | @@ -314,7 +320,7 @@ ENTRY(ia32_cstar_target) | ||
107 | testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10) | ||
108 | CFI_REMEMBER_STATE | ||
109 | jnz cstar_tracesys | ||
110 | - cmpl $IA32_NR_syscalls-1,%eax | ||
111 | + cmpq $IA32_NR_syscalls-1,%rax | ||
112 | ja ia32_badsys | ||
113 | cstar_do_call: | ||
114 | IA32_ARG_FIXUP 1 | ||
115 | @@ -367,7 +373,7 @@ cstar_tracesys: | ||
116 | LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */ | ||
117 | RESTORE_REST | ||
118 | xchgl %ebp,%r9d | ||
119 | - cmpl $(IA32_NR_syscalls-1),%eax | ||
120 | + cmpq $(IA32_NR_syscalls-1),%rax | ||
121 | ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */ | ||
122 | jmp cstar_do_call | ||
123 | END(ia32_cstar_target) | ||
124 | @@ -425,7 +431,7 @@ ENTRY(ia32_syscall) | ||
125 | orl $TS_COMPAT,TI_status(%r10) | ||
126 | testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10) | ||
127 | jnz ia32_tracesys | ||
128 | - cmpl $(IA32_NR_syscalls-1),%eax | ||
129 | + cmpq $(IA32_NR_syscalls-1),%rax | ||
130 | ja ia32_badsys | ||
131 | ia32_do_call: | ||
132 | IA32_ARG_FIXUP | ||
133 | @@ -444,7 +450,7 @@ ia32_tracesys: | ||
134 | call syscall_trace_enter | ||
135 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ | ||
136 | RESTORE_REST | ||
137 | - cmpl $(IA32_NR_syscalls-1),%eax | ||
138 | + cmpq $(IA32_NR_syscalls-1),%rax | ||
139 | ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */ | ||
140 | jmp ia32_do_call | ||
141 | END(ia32_syscall) | ||
142 | diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c | ||
143 | index 1692de3..195aea4 100644 | ||
144 | --- a/drivers/hwmon/f75375s.c | ||
145 | +++ b/drivers/hwmon/f75375s.c | ||
146 | @@ -79,7 +79,7 @@ I2C_CLIENT_INSMOD_2(f75373, f75375); | ||
147 | #define F75375_REG_PWM2_DROP_DUTY 0x6C | ||
148 | |||
149 | #define FAN_CTRL_LINEAR(nr) (4 + nr) | ||
150 | -#define FAN_CTRL_MODE(nr) (5 + ((nr) * 2)) | ||
151 | +#define FAN_CTRL_MODE(nr) (4 + ((nr) * 2)) | ||
152 | |||
153 | /* | ||
154 | * Data structures and manipulation thereof | ||
155 | @@ -298,7 +298,7 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) | ||
156 | return -EINVAL; | ||
157 | |||
158 | fanmode = f75375_read8(client, F75375_REG_FAN_TIMER); | ||
159 | - fanmode = ~(3 << FAN_CTRL_MODE(nr)); | ||
160 | + fanmode &= ~(3 << FAN_CTRL_MODE(nr)); | ||
161 | |||
162 | switch (val) { | ||
163 | case 0: /* Full speed */ | ||
164 | @@ -350,7 +350,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr, | ||
165 | |||
166 | mutex_lock(&data->update_lock); | ||
167 | conf = f75375_read8(client, F75375_REG_CONFIG1); | ||
168 | - conf = ~(1 << FAN_CTRL_LINEAR(nr)); | ||
169 | + conf &= ~(1 << FAN_CTRL_LINEAR(nr)); | ||
170 | |||
171 | if (val == 0) | ||
172 | conf |= (1 << FAN_CTRL_LINEAR(nr)) ; | ||
173 | diff --git a/drivers/net/wireless/ath9k/ath9k.h b/drivers/net/wireless/ath9k/ath9k.h | ||
174 | index 8ccf374..e4babfb 100644 | ||
175 | --- a/drivers/net/wireless/ath9k/ath9k.h | ||
176 | +++ b/drivers/net/wireless/ath9k/ath9k.h | ||
177 | @@ -554,7 +554,7 @@ enum ath9k_cipher { | ||
178 | |||
179 | #define SD_NO_CTL 0xE0 | ||
180 | #define NO_CTL 0xff | ||
181 | -#define CTL_MODE_M 7 | ||
182 | +#define CTL_MODE_M 0xf | ||
183 | #define CTL_11A 0 | ||
184 | #define CTL_11B 1 | ||
185 | #define CTL_11G 2 | ||
186 | diff --git a/drivers/power/apm_power.c b/drivers/power/apm_power.c | ||
187 | index 936bae5..dc628cb 100644 | ||
188 | --- a/drivers/power/apm_power.c | ||
189 | +++ b/drivers/power/apm_power.c | ||
190 | @@ -233,6 +233,7 @@ static int calculate_capacity(enum apm_source source) | ||
191 | empty_design_prop = POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN; | ||
192 | now_prop = POWER_SUPPLY_PROP_ENERGY_NOW; | ||
193 | avg_prop = POWER_SUPPLY_PROP_ENERGY_AVG; | ||
194 | + break; | ||
195 | case SOURCE_VOLTAGE: | ||
196 | full_prop = POWER_SUPPLY_PROP_VOLTAGE_MAX; | ||
197 | empty_prop = POWER_SUPPLY_PROP_VOLTAGE_MIN; | ||
198 | diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h | ||
199 | index 6c5b409..8df5cee 100644 | ||
200 | --- a/include/asm-mips/compat.h | ||
201 | +++ b/include/asm-mips/compat.h | ||
202 | @@ -145,7 +145,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) | ||
203 | return (u32)(unsigned long)uptr; | ||
204 | } | ||
205 | |||
206 | -static inline void __user *compat_alloc_user_space(long len) | ||
207 | +static inline void __user *arch_compat_alloc_user_space(long len) | ||
208 | { | ||
209 | struct pt_regs *regs = (struct pt_regs *) | ||
210 | ((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1; | ||
211 | diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h | ||
212 | index 7f32611..7c77fa9 100644 | ||
213 | --- a/include/asm-parisc/compat.h | ||
214 | +++ b/include/asm-parisc/compat.h | ||
215 | @@ -146,7 +146,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) | ||
216 | return (u32)(unsigned long)uptr; | ||
217 | } | ||
218 | |||
219 | -static __inline__ void __user *compat_alloc_user_space(long len) | ||
220 | +static __inline__ void __user *arch_compat_alloc_user_space(long len) | ||
221 | { | ||
222 | struct pt_regs *regs = ¤t->thread.regs; | ||
223 | return (void __user *)regs->gr[30]; | ||
224 | diff --git a/include/asm-x86/compat.h b/include/asm-x86/compat.h | ||
225 | index 1793ac3..8b1b00e 100644 | ||
226 | --- a/include/asm-x86/compat.h | ||
227 | +++ b/include/asm-x86/compat.h | ||
228 | @@ -204,7 +204,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) | ||
229 | return (u32)(unsigned long)uptr; | ||
230 | } | ||
231 | |||
232 | -static inline void __user *compat_alloc_user_space(long len) | ||
233 | +static inline void __user *arch_compat_alloc_user_space(long len) | ||
234 | { | ||
235 | struct pt_regs *regs = task_pt_regs(current); | ||
236 | return (void __user *)regs->sp - len; | ||
237 | diff --git a/include/linux/compat.h b/include/linux/compat.h | ||
238 | index 275b9bd..8cb2fcf 100644 | ||
239 | --- a/include/linux/compat.h | ||
240 | +++ b/include/linux/compat.h | ||
241 | @@ -291,5 +291,7 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | ||
242 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | ||
243 | int flags, int mode); | ||
244 | |||
245 | +extern void __user *compat_alloc_user_space(unsigned long len); | ||
246 | + | ||
247 | #endif /* CONFIG_COMPAT */ | ||
248 | #endif /* _LINUX_COMPAT_H */ | ||
249 | diff --git a/kernel/compat.c b/kernel/compat.c | ||
250 | index 32c254a..e0cdde9 100644 | ||
251 | --- a/kernel/compat.c | ||
252 | +++ b/kernel/compat.c | ||
253 | @@ -23,6 +23,7 @@ | ||
254 | #include <linux/timex.h> | ||
255 | #include <linux/migrate.h> | ||
256 | #include <linux/posix-timers.h> | ||
257 | +#include <linux/module.h> | ||
258 | |||
259 | #include <asm/uaccess.h> | ||
260 | |||
261 | @@ -1081,3 +1082,24 @@ compat_sys_sysinfo(struct compat_sysinfo __user *info) | ||
262 | |||
263 | return 0; | ||
264 | } | ||
265 | + | ||
266 | +/* | ||
267 | + * Allocate user-space memory for the duration of a single system call, | ||
268 | + * in order to marshall parameters inside a compat thunk. | ||
269 | + */ | ||
270 | +void __user *compat_alloc_user_space(unsigned long len) | ||
271 | +{ | ||
272 | + void __user *ptr; | ||
273 | + | ||
274 | + /* If len would occupy more than half of the entire compat space... */ | ||
275 | + if (unlikely(len > (((compat_uptr_t)~0) >> 1))) | ||
276 | + return NULL; | ||
277 | + | ||
278 | + ptr = arch_compat_alloc_user_space(len); | ||
279 | + | ||
280 | + if (unlikely(!access_ok(VERIFY_WRITE, ptr, len))) | ||
281 | + return NULL; | ||
282 | + | ||
283 | + return ptr; | ||
284 | +} | ||
285 | +EXPORT_SYMBOL_GPL(compat_alloc_user_space); | ||
286 | diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c | ||
287 | index f6e3af3..c8b8105 100644 | ||
288 | --- a/kernel/trace/ftrace.c | ||
289 | +++ b/kernel/trace/ftrace.c | ||
290 | @@ -1456,7 +1456,7 @@ static struct file_operations ftrace_filter_fops = { | ||
291 | .open = ftrace_filter_open, | ||
292 | .read = ftrace_regex_read, | ||
293 | .write = ftrace_filter_write, | ||
294 | - .llseek = ftrace_regex_lseek, | ||
295 | + .llseek = no_llseek, | ||
296 | .release = ftrace_filter_release, | ||
297 | }; | ||
298 | |||
299 | diff --git a/mm/bounce.c b/mm/bounce.c | ||
300 | index b6d2d0f..e83e280 100644 | ||
301 | --- a/mm/bounce.c | ||
302 | +++ b/mm/bounce.c | ||
303 | @@ -114,8 +114,8 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from) | ||
304 | */ | ||
305 | vfrom = page_address(fromvec->bv_page) + tovec->bv_offset; | ||
306 | |||
307 | - flush_dcache_page(tovec->bv_page); | ||
308 | bounce_copy_vec(tovec, vfrom); | ||
309 | + flush_dcache_page(tovec->bv_page); | ||
310 | } | ||
311 | } | ||
312 | |||
313 | diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c | ||
314 | index 9a1cd87..b00f5d1 100644 | ||
315 | --- a/net/irda/irlan/irlan_common.c | ||
316 | +++ b/net/irda/irlan/irlan_common.c | ||
317 | @@ -1100,7 +1100,7 @@ int irlan_extract_param(__u8 *buf, char *name, char *value, __u16 *len) | ||
318 | memcpy(&val_len, buf+n, 2); /* To avoid alignment problems */ | ||
319 | le16_to_cpus(&val_len); n+=2; | ||
320 | |||
321 | - if (val_len > 1016) { | ||
322 | + if (val_len >= 1016) { | ||
323 | IRDA_DEBUG(2, "%s(), parameter length to long\n", __func__ ); | ||
324 | return -RSP_INVALID_COMMAND_FORMAT; | ||
325 | } | ||
326 | diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c | ||
327 | index d0d721c..1f133fe 100644 | ||
328 | --- a/sound/core/seq/oss/seq_oss_init.c | ||
329 | +++ b/sound/core/seq/oss/seq_oss_init.c | ||
330 | @@ -280,13 +280,10 @@ snd_seq_oss_open(struct file *file, int level) | ||
331 | return 0; | ||
332 | |||
333 | _error: | ||
334 | - snd_seq_oss_writeq_delete(dp->writeq); | ||
335 | - snd_seq_oss_readq_delete(dp->readq); | ||
336 | snd_seq_oss_synth_cleanup(dp); | ||
337 | snd_seq_oss_midi_cleanup(dp); | ||
338 | - delete_port(dp); | ||
339 | delete_seq_queue(dp->queue); | ||
340 | - kfree(dp); | ||
341 | + delete_port(dp); | ||
342 | |||
343 | return rc; | ||
344 | } | ||
345 | @@ -349,8 +346,10 @@ create_port(struct seq_oss_devinfo *dp) | ||
346 | static int | ||
347 | delete_port(struct seq_oss_devinfo *dp) | ||
348 | { | ||
349 | - if (dp->port < 0) | ||
350 | + if (dp->port < 0) { | ||
351 | + kfree(dp); | ||
352 | return 0; | ||
353 | + } | ||
354 | |||
355 | debug_printk(("delete_port %i\n", dp->port)); | ||
356 | return snd_seq_event_port_detach(dp->cseq, dp->port); |