Commit 10e4ecd3 authored by David Woodhouse's avatar David Woodhouse Committed by Linus Torvalds

[PATCH] TASK_SIZE is variable.

Bad things can happen if a 32-bit process is the last user of a 64-bit mm. 
TASK_SIZE isn't a constant, and we can end up clearing page tables only up
to the 32-bit TASK_SIZE instead of all the way.  We should probably
double-check every instance of TASK_SIZE or USER_PTRS_PER_PGD for this kind
of problem.

We should also double-check that MM_VM_SIZE() and other such things are
correctly defined on all architectures.  I already fixed ppc64 which let it
stay as TASK_SIZE, and hence dependent on the _current_ context instead of
the mm in the argument.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ab2674c7
......@@ -1612,8 +1612,8 @@ static void free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *prev,
unsigned long last = end + PGDIR_SIZE - 1;
struct mm_struct *mm = tlb->mm;
if (last > TASK_SIZE || last < end)
last = TASK_SIZE;
if (last > MM_VM_SIZE(mm) || last < end)
last = MM_VM_SIZE(mm);
if (!prev) {
prev = mm->mmap;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment