diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-10-30 10:16:08 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-10-30 10:16:15 -0400 |
commit | e73b7fffe487c315fd1a4fa22282e3362b440a06 (patch) | |
tree | a6e2e205054d042e2512aba0f54d610233b94001 /arch/s390/mm | |
parent | a45aff5285871bf7be1781d9462d3fdbb6c913f9 (diff) |
[S390] memory leak with RCU_TABLE_FREE
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).
Cc: stable@kernel.org
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-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 5d56c2b95b14..529a08838376 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -662,8 +662,9 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table) | |||
662 | 662 | ||
663 | void __tlb_remove_table(void *_table) | 663 | void __tlb_remove_table(void *_table) |
664 | { | 664 | { |
665 | void *table = (void *)((unsigned long) _table & PAGE_MASK); | 665 | const unsigned long mask = (FRAG_MASK << 4) | FRAG_MASK; |
666 | unsigned type = (unsigned long) _table & ~PAGE_MASK; | 666 | void *table = (void *)((unsigned long) _table & ~mask); |
667 | unsigned type = (unsigned long) _table & mask; | ||
667 | 668 | ||
668 | if (type) | 669 | if (type) |
669 | __page_table_free_rcu(table, type); | 670 | __page_table_free_rcu(table, type); |