static inline void arch_unmap(struct mm_struct *mm,
unsigned long start, unsigned long end)
{
- unsigned long vdso_base = (unsigned long)mm->context.vdso;
+ unsigned long vdso_base = (unsigned long)mm->context.vdso - PAGE_SIZE;
if (start <= vdso_base && vdso_base < end)
mm->context.vdso = NULL;
if (new_size != text_size + PAGE_SIZE)
return -EINVAL;
- current->mm->context.vdso = (void __user *)new_vma->vm_start;
+ current->mm->context.vdso = (void __user *)new_vma->vm_start + PAGE_SIZE;
return 0;
}
* install_special_mapping or the perf counter mmap tracking code
* will fail to recognise it as a vDSO.
*/
- mm->context.vdso = (void __user *)vdso_base;
+ mm->context.vdso = (void __user *)vdso_base + PAGE_SIZE;
/*
* our vma flags don't have VM_WRITE so by default, the process isn't
return -1;
}
*((int *)(vdso64_kbase + sym64->st_value - VDSO64_LBASE)) =
- (vdso64_pages << PAGE_SHIFT) -
+ -PAGE_SIZE -
(sym64->st_value - VDSO64_LBASE);
#endif /* CONFIG_PPC64 */
return -1;
}
*((int *)(vdso32_kbase + (sym32->st_value - VDSO32_LBASE))) =
- (vdso32_pages << PAGE_SHIFT) -
+ -PAGE_SIZE -
(sym32->st_value - VDSO32_LBASE);
#endif
if (!pagelist)
panic("%s: Cannot allocate page list for VDSO", __func__);
- for (i = 0; i < pages; i++)
- pagelist[i] = virt_to_page(start + i * PAGE_SIZE);
+ pagelist[0] = virt_to_page(vdso_data);
- pagelist[i] = virt_to_page(vdso_data);
+ for (i = 0; i < pages; i++)
+ pagelist[i + 1] = virt_to_page(start + i * PAGE_SIZE);
return pagelist;
}