diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-10-30 10:16:08 -0400 |
---|---|---|
committer | Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> | 2011-11-21 12:55:01 -0500 |
commit | 491b3970d6f7b5c6aecc62c71b49bef9c4ceaad5 (patch) | |
tree | 1914de66af336fb9ef9f7aad15ffb7a185767b4d /arch | |
parent | 2d8aaf0b43cb73d8f0f312211d8cc9050eb48b58 (diff) |
memory leak with RCU_TABLE_FREE
BugLink: http://bugs.launchpad.net/bugs/890952
commit e73b7fffe487c315fd1a4fa22282e3362b440a06 upstream.
The rcu page table free code uses a couple of bits in the page table
pointer passed to tlb_remove_table to discern the different page table
types. __tlb_remove_table extracts the type with an incorrect mask which
leads to memory leaks. The correct mask is ((FRAG_MASK << 4) | FRAG_MASK).
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/mm/pgtable.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 37a23c22370..458893f5f6b 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -291,8 +291,9 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table) | |||
291 | 291 | ||
292 | void __tlb_remove_table(void *_table) | 292 | void __tlb_remove_table(void *_table) |
293 | { | 293 | { |
294 | void *table = (void *)((unsigned long) _table & PAGE_MASK); | 294 | const unsigned long mask = (FRAG_MASK << 4) | FRAG_MASK; |
295 | unsigned type = (unsigned long) _table & ~PAGE_MASK; | 295 | void *table = (void *)((unsigned long) _table & ~mask); |
296 | unsigned type = (unsigned long) _table & mask; | ||
296 | 297 | ||
297 | if (type) | 298 | if (type) |
298 | __page_table_free_rcu(table, type); | 299 | __page_table_free_rcu(table, type); |