--- /dev/null
+From d8e1ba76d619dbc0be8fbeee4e6c683b5c812d3a Mon Sep 17 00:00:00 2001
+From: John W. Linville <linville@tuxdriver.com>
+Date: Tue, 24 Aug 2010 15:27:34 -0400
+Subject: ath5k: check return value of ieee80211_get_tx_rate
+
+From: John W. Linville <linville@tuxdriver.com>
+
+commit d8e1ba76d619dbc0be8fbeee4e6c683b5c812d3a upstream.
+
+This avoids a NULL pointer dereference as reported here:
+
+ https://bugzilla.redhat.com/show_bug.cgi?id=625889
+
+When the WARN condition is hit in ieee80211_get_tx_rate, it will return
+NULL. So, we need to check the return value and avoid dereferencing it
+in that case.
+
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Acked-by: Bob Copeland <me@bobcopeland.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/wireless/ath/ath5k/base.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/wireless/ath/ath5k/base.c
++++ b/drivers/net/wireless/ath/ath5k/base.c
+@@ -1288,6 +1288,10 @@ ath5k_txbuf_setup(struct ath5k_softc *sc
+ PCI_DMA_TODEVICE);
+
+ rate = ieee80211_get_tx_rate(sc->hw, info);
++ if (!rate) {
++ ret = -EINVAL;
++ goto err_unmap;
++ }
+
+ if (info->flags & IEEE80211_TX_CTL_NO_ACK)
+ flags |= AR5K_TXDESC_NOACK;
--- /dev/null
+From ee3aebdd8f5f8eac41c25c80ceee3d728f920f3b Mon Sep 17 00:00:00 2001
+From: Jan Sembera <jsembera@suse.cz>
+Date: Thu, 9 Sep 2010 16:37:54 -0700
+Subject: binfmt_misc: fix binfmt_misc priority
+
+From: Jan Sembera <jsembera@suse.cz>
+
+commit ee3aebdd8f5f8eac41c25c80ceee3d728f920f3b upstream.
+
+Commit 74641f584da ("alpha: binfmt_aout fix") (May 2009) introduced a
+regression - binfmt_misc is now consulted after binfmt_elf, which will
+unfortunately break ia32el. ia32 ELF binaries on ia64 used to be matched
+using binfmt_misc and executed using wrapper. As 32bit binaries are now
+matched by binfmt_elf before bindmt_misc kicks in, the wrapper is ignored.
+
+The fix increases precedence of binfmt_misc to the original state.
+
+Signed-off-by: Jan Sembera <jsembera@suse.cz>
+Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
+Cc: Al Viro <viro@ZenIV.linux.org.uk>
+Cc: Richard Henderson <rth@twiddle.net
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/binfmt_misc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/binfmt_misc.c
++++ b/fs/binfmt_misc.c
+@@ -723,7 +723,7 @@ static int __init init_misc_binfmt(void)
+ {
+ int err = register_filesystem(&bm_fs_type);
+ if (!err) {
+- err = register_binfmt(&misc_format);
++ err = insert_binfmt(&misc_format);
+ if (err)
+ unregister_filesystem(&bm_fs_type);
+ }
--- /dev/null
+From ac8456d6f9a3011c824176bd6084d39e5f70a382 Mon Sep 17 00:00:00 2001
+From: Gary King <gking@nvidia.com>
+Date: Thu, 9 Sep 2010 16:38:05 -0700
+Subject: bounce: call flush_dcache_page() after bounce_copy_vec()
+
+From: Gary King <gking@nvidia.com>
+
+commit ac8456d6f9a3011c824176bd6084d39e5f70a382 upstream.
+
+I have been seeing problems on Tegra 2 (ARMv7 SMP) systems with HIGHMEM
+enabled on 2.6.35 (plus some patches targetted at 2.6.36 to perform cache
+maintenance lazily), and the root cause appears to be that the mm bouncing
+code is calling flush_dcache_page before it copies the bounce buffer into
+the bio.
+
+The bounced page needs to be flushed after data is copied into it, to
+ensure that architecture implementations can synchronize instruction and
+data caches if necessary.
+
+Signed-off-by: Gary King <gking@nvidia.com>
+Cc: Tejun Heo <tj@kernel.org>
+Cc: Russell King <rmk@arm.linux.org.uk>
+Acked-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ mm/bounce.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/mm/bounce.c
++++ b/mm/bounce.c
+@@ -115,8 +115,8 @@ static void copy_to_high_bio_irq(struct
+ */
+ vfrom = page_address(fromvec->bv_page) + tovec->bv_offset;
+
+- flush_dcache_page(tovec->bv_page);
+ bounce_copy_vec(tovec, vfrom);
++ flush_dcache_page(tovec->bv_page);
+ }
+ }
+
--- /dev/null
+From c41d68a513c71e35a14f66d71782d27a79a81ea6 Mon Sep 17 00:00:00 2001
+From: H. Peter Anvin <hpa@linux.intel.com>
+Date: Tue, 7 Sep 2010 16:16:18 -0700
+Subject: compat: Make compat_alloc_user_space() incorporate the access_ok()
+
+From: H. Peter Anvin <hpa@linux.intel.com>
+
+commit c41d68a513c71e35a14f66d71782d27a79a81ea6 upstream.
+
+compat_alloc_user_space() expects the caller to independently call
+access_ok() to verify the returned area. A missing call could
+introduce problems on some architectures.
+
+This patch incorporates the access_ok() check into
+compat_alloc_user_space() and also adds a sanity check on the length.
+The existing compat_alloc_user_space() implementations are renamed
+arch_compat_alloc_user_space() and are used as part of the
+implementation of the new global function.
+
+This patch assumes NULL will cause __get_user()/__put_user() to either
+fail or access userspace on all architectures. This should be
+followed by checking the return value of compat_access_user_space()
+for NULL in the callers, at which time the access_ok() in the callers
+can also be removed.
+
+Reported-by: Ben Hawkes <hawkes@sota.gen.nz>
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Acked-by: Chris Metcalf <cmetcalf@tilera.com>
+Acked-by: David S. Miller <davem@davemloft.net>
+Acked-by: Ingo Molnar <mingo@elte.hu>
+Acked-by: Thomas Gleixner <tglx@linutronix.de>
+Acked-by: Tony Luck <tony.luck@intel.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Arnd Bergmann <arnd@arndb.de>
+Cc: Fenghua Yu <fenghua.yu@intel.com>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
+Cc: Helge Deller <deller@gmx.de>
+Cc: James Bottomley <jejb@parisc-linux.org>
+Cc: Kyle McMartin <kyle@mcmartin.ca>
+Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Cc: Paul Mackerras <paulus@samba.org>
+Cc: Ralf Baechle <ralf@linux-mips.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/ia64/include/asm/compat.h | 2 +-
+ arch/mips/include/asm/compat.h | 2 +-
+ arch/parisc/include/asm/compat.h | 2 +-
+ arch/powerpc/include/asm/compat.h | 2 +-
+ arch/s390/include/asm/compat.h | 2 +-
+ arch/sparc/include/asm/compat.h | 2 +-
+ arch/x86/include/asm/compat.h | 2 +-
+ include/linux/compat.h | 2 ++
+ kernel/compat.c | 21 +++++++++++++++++++++
+ 9 files changed, 30 insertions(+), 7 deletions(-)
+
+--- a/arch/ia64/include/asm/compat.h
++++ b/arch/ia64/include/asm/compat.h
+@@ -198,7 +198,7 @@ ptr_to_compat(void __user *uptr)
+ }
+
+ static __inline__ void __user *
+-compat_alloc_user_space (long len)
++arch_compat_alloc_user_space (long len)
+ {
+ struct pt_regs *regs = task_pt_regs(current);
+ return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len);
+--- a/arch/mips/include/asm/compat.h
++++ b/arch/mips/include/asm/compat.h
+@@ -144,7 +144,7 @@ static inline compat_uptr_t ptr_to_compa
+ return (u32)(unsigned long)uptr;
+ }
+
+-static inline void __user *compat_alloc_user_space(long len)
++static inline void __user *arch_compat_alloc_user_space(long len)
+ {
+ struct pt_regs *regs = (struct pt_regs *)
+ ((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1;
+--- a/arch/parisc/include/asm/compat.h
++++ b/arch/parisc/include/asm/compat.h
+@@ -146,7 +146,7 @@ static inline compat_uptr_t ptr_to_compa
+ return (u32)(unsigned long)uptr;
+ }
+
+-static __inline__ void __user *compat_alloc_user_space(long len)
++static __inline__ void __user *arch_compat_alloc_user_space(long len)
+ {
+ struct pt_regs *regs = ¤t->thread.regs;
+ return (void __user *)regs->gr[30];
+--- a/arch/powerpc/include/asm/compat.h
++++ b/arch/powerpc/include/asm/compat.h
+@@ -133,7 +133,7 @@ static inline compat_uptr_t ptr_to_compa
+ return (u32)(unsigned long)uptr;
+ }
+
+-static inline void __user *compat_alloc_user_space(long len)
++static inline void __user *arch_compat_alloc_user_space(long len)
+ {
+ struct pt_regs *regs = current->thread.regs;
+ unsigned long usp = regs->gpr[1];
+--- a/arch/s390/include/asm/compat.h
++++ b/arch/s390/include/asm/compat.h
+@@ -180,7 +180,7 @@ static inline int is_compat_task(void)
+
+ #endif
+
+-static inline void __user *compat_alloc_user_space(long len)
++static inline void __user *arch_compat_alloc_user_space(long len)
+ {
+ unsigned long stack;
+
+--- a/arch/sparc/include/asm/compat.h
++++ b/arch/sparc/include/asm/compat.h
+@@ -166,7 +166,7 @@ static inline compat_uptr_t ptr_to_compa
+ return (u32)(unsigned long)uptr;
+ }
+
+-static inline void __user *compat_alloc_user_space(long len)
++static inline void __user *arch_compat_alloc_user_space(long len)
+ {
+ struct pt_regs *regs = current_thread_info()->kregs;
+ unsigned long usp = regs->u_regs[UREG_I6];
+--- a/arch/x86/include/asm/compat.h
++++ b/arch/x86/include/asm/compat.h
+@@ -204,7 +204,7 @@ static inline compat_uptr_t ptr_to_compa
+ return (u32)(unsigned long)uptr;
+ }
+
+-static inline void __user *compat_alloc_user_space(long len)
++static inline void __user *arch_compat_alloc_user_space(long len)
+ {
+ struct pt_regs *regs = task_pt_regs(current);
+ return (void __user *)regs->sp - len;
+--- a/include/linux/compat.h
++++ b/include/linux/compat.h
+@@ -309,5 +309,7 @@ asmlinkage long compat_sys_newfstatat(un
+ asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
+ int flags, int mode);
+
++extern void __user *compat_alloc_user_space(unsigned long len);
++
+ #endif /* CONFIG_COMPAT */
+ #endif /* _LINUX_COMPAT_H */
+--- a/kernel/compat.c
++++ b/kernel/compat.c
+@@ -1136,3 +1136,24 @@ compat_sys_sysinfo(struct compat_sysinfo
+
+ return 0;
+ }
++
++/*
++ * Allocate user-space memory for the duration of a single system call,
++ * in order to marshall parameters inside a compat thunk.
++ */
++void __user *compat_alloc_user_space(unsigned long len)
++{
++ void __user *ptr;
++
++ /* If len would occupy more than half of the entire compat space... */
++ if (unlikely(len > (((compat_uptr_t)~0) >> 1)))
++ return NULL;
++
++ ptr = arch_compat_alloc_user_space(len);
++
++ if (unlikely(!access_ok(VERIFY_WRITE, ptr, len)))
++ return NULL;
++
++ return ptr;
++}
++EXPORT_SYMBOL_GPL(compat_alloc_user_space);
--- /dev/null
+From af045b86662f17bf130239a65995c61a34f00a6b Mon Sep 17 00:00:00 2001
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Date: Tue, 31 Aug 2010 17:27:02 -0700
+Subject: Input: i8042 - fix device removal on unload
+
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+
+commit af045b86662f17bf130239a65995c61a34f00a6b upstream.
+
+We need to call platform_device_unregister(i8042_platform_device)
+before calling platform_driver_unregister() because i8042_remove()
+resets i8042_platform_device to NULL. This leaves the platform device
+instance behind and prevents driver reload.
+
+Fixes https://bugzilla.kernel.org/show_bug.cgi?id=16613
+
+Reported-by: Seryodkin Victor <vvscore@gmail.com>
+Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/input/serio/i8042.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/input/serio/i8042.c
++++ b/drivers/input/serio/i8042.c
+@@ -1412,8 +1412,8 @@ static int __init i8042_init(void)
+
+ static void __exit i8042_exit(void)
+ {
+- platform_driver_unregister(&i8042_driver);
+ platform_device_unregister(i8042_platform_device);
++ platform_driver_unregister(&i8042_driver);
+ i8042_platform_exit();
+
+ panic_blink = NULL;
--- /dev/null
+From 1c24de60e50fb19b94d94225458da17c720f0729 Mon Sep 17 00:00:00 2001
+From: Jerome Marchand <jmarchan@redhat.com>
+Date: Thu, 9 Sep 2010 16:37:59 -0700
+Subject: kernel/groups.c: fix integer overflow in groups_search
+
+From: Jerome Marchand <jmarchan@redhat.com>
+
+commit 1c24de60e50fb19b94d94225458da17c720f0729 upstream.
+
+gid_t is a unsigned int. If group_info contains a gid greater than
+MAX_INT, groups_search() function may look on the wrong side of the search
+tree.
+
+This solves some unfair "permission denied" problems.
+
+Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/groups.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/kernel/groups.c
++++ b/kernel/groups.c
+@@ -143,10 +143,9 @@ int groups_search(const struct group_inf
+ right = group_info->ngroups;
+ while (left < right) {
+ unsigned int mid = (left+right)/2;
+- int cmp = grp - GROUP_AT(group_info, mid);
+- if (cmp > 0)
++ if (grp > GROUP_AT(group_info, mid))
+ left = mid + 1;
+- else if (cmp < 0)
++ else if (grp < GROUP_AT(group_info, mid))
+ right = mid;
+ else
+ return 1;
--- /dev/null
+From 0dcc48c15f63ee86c2fcd33968b08d651f0360a5 Mon Sep 17 00:00:00 2001
+From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
+Date: Thu, 9 Sep 2010 16:38:01 -0700
+Subject: memory hotplug: fix next block calculation in is_removable
+
+From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
+
+commit 0dcc48c15f63ee86c2fcd33968b08d651f0360a5 upstream.
+
+next_active_pageblock() is for finding next _used_ freeblock. It skips
+several blocks when it finds there are a chunk of free pages lager than
+pageblock. But it has 2 bugs.
+
+ 1. We have no lock. page_order(page) - pageblock_order can be minus.
+ 2. pageblocks_stride += is wrong. it should skip page_order(p) of pages.
+
+Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
+Cc: Michal Hocko <mhocko@suse.cz>
+Cc: Wu Fengguang <fengguang.wu@intel.com>
+Cc: Mel Gorman <mel@csn.ul.ie>
+Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ mm/memory_hotplug.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+--- a/mm/memory_hotplug.c
++++ b/mm/memory_hotplug.c
+@@ -551,19 +551,19 @@ static inline int pageblock_free(struct
+ /* Return the start of the next active pageblock after a given page */
+ static struct page *next_active_pageblock(struct page *page)
+ {
+- int pageblocks_stride;
+-
+ /* Ensure the starting page is pageblock-aligned */
+ BUG_ON(page_to_pfn(page) & (pageblock_nr_pages - 1));
+
+- /* Move forward by at least 1 * pageblock_nr_pages */
+- pageblocks_stride = 1;
+-
+ /* If the entire pageblock is free, move to the end of free page */
+- if (pageblock_free(page))
+- pageblocks_stride += page_order(page) - pageblock_order;
++ if (pageblock_free(page)) {
++ int order;
++ /* be careful. we don't have locks, page_order can be changed.*/
++ order = page_order(page);
++ if ((order < MAX_ORDER) && (order >= pageblock_order))
++ return page + (1 << order);
++ }
+
+- return page + (pageblocks_stride * pageblock_nr_pages);
++ return page + pageblock_nr_pages;
+ }
+
+ /* Checks if this range of memory is likely to be hot-removable. */
--- /dev/null
+From f880c2050f30b23c9b6f80028c09f76e693bf309 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey@googlemail.com>
+Date: Tue, 24 Aug 2010 22:54:05 +0200
+Subject: p54: fix tx feedback status flag check
+
+From: Christian Lamparter <chunkeey@googlemail.com>
+
+commit f880c2050f30b23c9b6f80028c09f76e693bf309 upstream.
+
+Michael reported that p54* never really entered power
+save mode, even tough it was enabled.
+
+It turned out that upon a power save mode change the
+firmware will set a special flag onto the last outgoing
+frame tx status (which in this case is almost always the
+designated PSM nullfunc frame). This flag confused the
+driver; It erroneously reported transmission failures
+to the stack, which then generated the next nullfunc.
+and so on...
+
+Reported-by: Michael Buesch <mb@bu3sch.de>
+Tested-by: Michael Buesch <mb@bu3sch.de>
+Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/wireless/p54/txrx.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/p54/txrx.c
++++ b/drivers/net/wireless/p54/txrx.c
+@@ -445,7 +445,7 @@ static void p54_rx_frame_sent(struct p54
+ }
+
+ if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) &&
+- (!payload->status))
++ !(payload->status & P54_TX_FAILED))
+ info->flags |= IEEE80211_TX_STAT_ACK;
+ if (payload->status & P54_TX_PSM_CANCELLED)
+ info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
--- /dev/null
+From a002d148426f40bc2b7dc066982eb177cdebeaaa Mon Sep 17 00:00:00 2001
+From: Huang Shijie <shijie8@gmail.com>
+Date: Sun, 8 Aug 2010 14:39:07 +0200
+Subject: percpu: fix a memory leak in pcpu_extend_area_map()
+
+From: Huang Shijie <shijie8@gmail.com>
+
+commit a002d148426f40bc2b7dc066982eb177cdebeaaa upstream.
+
+The original code did not free the old map. This patch fixes it.
+
+tj: use @old as memcpy source instead of @chunk->map, and indentation
+ and description update
+
+Signed-off-by: Huang Shijie <shijie8@gmail.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ mm/percpu.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/mm/percpu.c
++++ b/mm/percpu.c
+@@ -412,7 +412,9 @@ static int pcpu_extend_area_map(struct p
+ goto out_unlock;
+
+ old_size = chunk->map_alloc * sizeof(chunk->map[0]);
+- memcpy(new, chunk->map, old_size);
++ old = chunk->map;
++
++ memcpy(new, old, old_size);
+
+ /*
+ * map_alloc < PCPU_DFL_MAP_ALLOC indicates that the chunk is
--- /dev/null
+From 5225c45899e872383ca39f5533d28ec63c54b39e Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Sun, 22 Aug 2010 04:29:17 +0200
+Subject: perf: Initialize callchains roots's childen hits
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 5225c45899e872383ca39f5533d28ec63c54b39e upstream.
+
+Each histogram entry has a callchain root that stores the
+callchain samples. However we forgot to initialize the
+tracking of children hits of these roots, which then got
+random values on their creation.
+
+The root children hits is multiplied by the minimum percentage
+of hits provided by the user, and the result becomes the minimum
+hits expected from children branches. If the random value due
+to the uninitialization is big enough, then this minimum number
+of hits can be huge and eventually filter every children branches.
+
+The end result was invisible callchains. All we need to
+fix this is to initialize the children hits of the root.
+
+Reported-by: Christoph Hellwig <hch@infradead.org>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Ingo Molnar <mingo@elte.hu>
+Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Paul Mackerras <paulus@samba.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ tools/perf/util/callchain.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/tools/perf/util/callchain.h
++++ b/tools/perf/util/callchain.h
+@@ -49,6 +49,7 @@ static inline void callchain_init(struct
+ INIT_LIST_HEAD(&node->children);
+ INIT_LIST_HEAD(&node->val);
+
++ node->children_hit = 0;
+ node->parent = NULL;
+ node->hit = 0;
+ }
gcov-fix-null-pointer-dereference-for-certain-module-types.patch
tmio_mmc-don-t-clear-unhandled-pending-interrupts.patch
mmc-fix-the-use-of-kunmap_atomic-in-tmio_mmc.h.patch
+bounce-call-flush_dcache_page-after-bounce_copy_vec.patch
+kernel-groups.c-fix-integer-overflow-in-groups_search.patch
+binfmt_misc-fix-binfmt_misc-priority.patch
+input-i8042-fix-device-removal-on-unload.patch
+memory-hotplug-fix-next-block-calculation-in-is_removable.patch
+perf-initialize-callchains-roots-s-childen-hits.patch
+p54-fix-tx-feedback-status-flag-check.patch
+ath5k-check-return-value-of-ieee80211_get_tx_rate.patch
+percpu-fix-a-memory-leak-in-pcpu_extend_area_map.patch
+wireless-extensions-fix-kernel-heap-content-leak.patch
+x86-tsc-fix-a-preemption-leak-in-restore_sched_clock_state.patch
+x86-64-compat-test-rax-for-the-syscall-number-not-eax.patch
+compat-make-compat_alloc_user_space-incorporate-the-access_ok.patch
--- /dev/null
+From 42da2f948d949efd0111309f5827bf0298bcc9a4 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Mon, 30 Aug 2010 12:24:54 +0200
+Subject: wireless extensions: fix kernel heap content leak
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit 42da2f948d949efd0111309f5827bf0298bcc9a4 upstream.
+
+Wireless extensions have an unfortunate, undocumented
+requirement which requires drivers to always fill
+iwp->length when returning a successful status. When
+a driver doesn't do this, it leads to a kernel heap
+content leak when userspace offers a larger buffer
+than would have been necessary.
+
+Arguably, this is a driver bug, as it should, if it
+returns 0, fill iwp->length, even if it separately
+indicated that the buffer contents was not valid.
+
+However, we can also at least avoid the memory content
+leak if the driver doesn't do this by setting the iwp
+length to max_tokens, which then reflects how big the
+buffer is that the driver may fill, regardless of how
+big the userspace buffer is.
+
+To illustrate the point, this patch also fixes a
+corresponding cfg80211 bug (since this requirement
+isn't documented nor was ever pointed out by anyone
+during code review, I don't trust all drivers nor
+all cfg80211 handlers to implement it correctly).
+
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ net/wireless/wext-compat.c | 3 +++
+ net/wireless/wext.c | 16 ++++++++++++++++
+ 2 files changed, 19 insertions(+)
+
+--- a/net/wireless/wext-compat.c
++++ b/net/wireless/wext-compat.c
+@@ -1358,6 +1358,9 @@ int cfg80211_wext_giwessid(struct net_de
+ {
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
++ data->flags = 0;
++ data->length = 0;
++
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
+--- a/net/wireless/wext.c
++++ b/net/wireless/wext.c
+@@ -854,6 +854,22 @@ static int ioctl_standard_iw_point(struc
+ }
+ }
+
++ if (IW_IS_GET(cmd) && !(descr->flags & IW_DESCR_FLAG_NOMAX)) {
++ /*
++ * If this is a GET, but not NOMAX, it means that the extra
++ * data is not bounded by userspace, but by max_tokens. Thus
++ * set the length to max_tokens. This matches the extra data
++ * allocation.
++ * The driver should fill it with the number of tokens it
++ * provided, and it may check iwp->length rather than having
++ * knowledge of max_tokens. If the driver doesn't change the
++ * iwp->length, this ioctl just copies back max_token tokens
++ * filled with zeroes. Hopefully the driver isn't claiming
++ * them to be valid data.
++ */
++ iwp->length = descr->max_tokens;
++ }
++
+ err = handler(dev, info, (union iwreq_data *) iwp, extra);
+
+ iwp->length += essid_compat;
--- /dev/null
+From 36d001c70d8a0144ac1d038f6876c484849a74de Mon Sep 17 00:00:00 2001
+From: H. Peter Anvin <hpa@linux.intel.com>
+Date: Tue, 14 Sep 2010 12:42:41 -0700
+Subject: x86-64, compat: Test %rax for the syscall number, not %eax
+
+From: H. Peter Anvin <hpa@linux.intel.com>
+
+commit 36d001c70d8a0144ac1d038f6876c484849a74de upstream.
+
+On 64 bits, we always, by necessity, jump through the system call
+table via %rax. For 32-bit system calls, in theory the system call
+number is stored in %eax, and the code was testing %eax for a valid
+system call number. At one point we loaded the stored value back from
+the stack to enforce zero-extension, but that was removed in checkin
+d4d67150165df8bf1cc05e532f6efca96f907cab. An actual 32-bit process
+will not be able to introduce a non-zero-extended number, but it can
+happen via ptrace.
+
+Instead of re-introducing the zero-extension, test what we are
+actually going to use, i.e. %rax. This only adds a handful of REX
+prefixes to the code.
+
+Reported-by: Ben Hawkes <hawkes@sota.gen.nz>
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+Cc: Roland McGrath <roland@redhat.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/ia32/ia32entry.S | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+--- a/arch/x86/ia32/ia32entry.S
++++ b/arch/x86/ia32/ia32entry.S
+@@ -153,7 +153,7 @@ ENTRY(ia32_sysenter_target)
+ testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
+ CFI_REMEMBER_STATE
+ jnz sysenter_tracesys
+- cmpl $(IA32_NR_syscalls-1),%eax
++ cmpq $(IA32_NR_syscalls-1),%rax
+ ja ia32_badsys
+ sysenter_do_call:
+ IA32_ARG_FIXUP
+@@ -195,7 +195,7 @@ sysexit_from_sys_call:
+ movl $AUDIT_ARCH_I386,%edi /* 1st arg: audit arch */
+ call audit_syscall_entry
+ movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */
+- cmpl $(IA32_NR_syscalls-1),%eax
++ cmpq $(IA32_NR_syscalls-1),%rax
+ ja ia32_badsys
+ movl %ebx,%edi /* reload 1st syscall arg */
+ movl RCX-ARGOFFSET(%rsp),%esi /* reload 2nd syscall arg */
+@@ -248,7 +248,7 @@ sysenter_tracesys:
+ call syscall_trace_enter
+ LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
+ RESTORE_REST
+- cmpl $(IA32_NR_syscalls-1),%eax
++ cmpq $(IA32_NR_syscalls-1),%rax
+ ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
+ jmp sysenter_do_call
+ CFI_ENDPROC
+@@ -314,7 +314,7 @@ ENTRY(ia32_cstar_target)
+ testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
+ CFI_REMEMBER_STATE
+ jnz cstar_tracesys
+- cmpl $IA32_NR_syscalls-1,%eax
++ cmpq $IA32_NR_syscalls-1,%rax
+ ja ia32_badsys
+ cstar_do_call:
+ IA32_ARG_FIXUP 1
+@@ -367,7 +367,7 @@ cstar_tracesys:
+ LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */
+ RESTORE_REST
+ xchgl %ebp,%r9d
+- cmpl $(IA32_NR_syscalls-1),%eax
++ cmpq $(IA32_NR_syscalls-1),%rax
+ ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */
+ jmp cstar_do_call
+ END(ia32_cstar_target)
+@@ -425,7 +425,7 @@ ENTRY(ia32_syscall)
+ orl $TS_COMPAT,TI_status(%r10)
+ testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
+ jnz ia32_tracesys
+- cmpl $(IA32_NR_syscalls-1),%eax
++ cmpq $(IA32_NR_syscalls-1),%rax
+ ja ia32_badsys
+ ia32_do_call:
+ IA32_ARG_FIXUP
+@@ -444,7 +444,7 @@ ia32_tracesys:
+ call syscall_trace_enter
+ LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
+ RESTORE_REST
+- cmpl $(IA32_NR_syscalls-1),%eax
++ cmpq $(IA32_NR_syscalls-1),%rax
+ ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */
+ jmp ia32_do_call
+ END(ia32_syscall)
--- /dev/null
+From 55496c896b8a695140045099d4e0175cf09d4eae Mon Sep 17 00:00:00 2001
+From: Peter Zijlstra <peterz@infradead.org>
+Date: Fri, 10 Sep 2010 22:32:53 +0200
+Subject: x86, tsc: Fix a preemption leak in restore_sched_clock_state()
+
+From: Peter Zijlstra <peterz@infradead.org>
+
+commit 55496c896b8a695140045099d4e0175cf09d4eae upstream.
+
+Doh, a real life genuine preemption leak..
+
+This caused a suspend failure.
+
+Reported-bisected-and-tested-by-the-invaluable: Jeff Chua <jeff.chua.linux@gmail.com>
+Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
+Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Cc: Rafael J. Wysocki <rjw@sisk.pl>
+Cc: Nico Schottelius <nico-linux-20100709@schottelius.org>
+Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Florian Pritz <flo@xssn.at>
+Cc: Suresh Siddha <suresh.b.siddha@intel.com>
+Cc: Len Brown <lenb@kernel.org>
+sleep states
+LKML-Reference: <1284150773.402.122.camel@laptop>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/tsc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/tsc.c
++++ b/arch/x86/kernel/tsc.c
+@@ -655,7 +655,7 @@ void restore_sched_clock_state(void)
+
+ local_irq_save(flags);
+
+- get_cpu_var(cyc2ns_offset) = 0;
++ __get_cpu_var(cyc2ns_offset) = 0;
+ offset = cyc2ns_suspend - sched_clock();
+
+ for_each_possible_cpu(cpu)