Re: [PATCH 1/6] mm: use mm_struct to resolve gate vma's in __get_user_pages

From: KOSAKI Motohiro
Date: Wed Mar 09 2011 - 00:19:55 EST


> We now check if a requested user page overlaps a gate vma using the supplied mm
> instead of the supplied task. The given task is now used solely for accounting
> purposes and may be NULL.
>
> Signed-off-by: Stephen Wilson <wilsons@xxxxxxxx>
> ---
> mm/memory.c | 18 +++++++++++-------
> 1 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 3863e86..36445e3 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1437,9 +1437,9 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
> struct vm_area_struct *vma;
>
> vma = find_extend_vma(mm, start);
> - if (!vma && in_gate_area(tsk->mm, start)) {
> + if (!vma && in_gate_area(mm, start)) {
> unsigned long pg = start & PAGE_MASK;
> - struct vm_area_struct *gate_vma = get_gate_vma(tsk->mm);
> + struct vm_area_struct *gate_vma = get_gate_vma(mm);
> pgd_t *pgd;
> pud_t *pud;
> pmd_t *pmd;

Hmm..
Is this works? In exec() case task has two mm, old and new-borned. tsk has
no enough information to detect gate area if 64bit process exec 32bit process
or oppsite case. On Linux, 32bit and 64bit processes have perfectly different
process vma layout.

Am I missing something?


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/