Patchwork UBUNTU: SAUCE: fix get_gate_vma call in i386 NX emulation code

login
register
mail settings
Submitter Herton Ronaldo Krzesinski
Date June 5, 2012, 8:29 p.m.
Message ID <1338928173-14623-1-git-send-email-herton.krzesinski@canonical.com>
Download mbox | patch
Permalink /patch/163161/
State New
Headers show

Comments

Herton Ronaldo Krzesinski - June 5, 2012, 8:29 p.m.
Since commit 31db58b3 ("mm: arch: make get_gate_vma take an mm_struct
instead of a task_struct"), that went in linux 2.6.39, get_gate_vma is
expected to take an struct mm_struct pointer as its parameter. But
get_gate_vma in i386 NX emulation code patch is still using the old way,
fix it.

BugLink: http://bugs.launchpad.net/bugs/1009200
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
 arch/x86/kernel/traps.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Herton Ronaldo Krzesinski - June 5, 2012, 8:41 p.m.
On Tue, Jun 05, 2012 at 05:29:33PM -0300, Herton Ronaldo Krzesinski wrote:
> Since commit 31db58b3 ("mm: arch: make get_gate_vma take an mm_struct
> instead of a task_struct"), that went in linux 2.6.39, get_gate_vma is
> expected to take an struct mm_struct pointer as its parameter. But
> get_gate_vma in i386 NX emulation code patch is still using the old way,
> fix it.

Forgot to add in the subject, this is an SRU for Precise and Oneiric.

> 
> BugLink: http://bugs.launchpad.net/bugs/1009200
> Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
> ---
>  arch/x86/kernel/traps.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index f463b43..f7c210d 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -142,7 +142,7 @@ check_lazy_exec_limit(int cpu, struct pt_regs *regs, long error_code)
>  		for (vma = current->mm->mmap; vma; vma = vma->vm_next)
>  			if ((vma->vm_flags & VM_EXEC) && (vma->vm_end > limit))
>  				limit = vma->vm_end;
> -		vma = get_gate_vma(current);
> +		vma = get_gate_vma(current->mm);
>  		if (vma && (vma->vm_flags & VM_EXEC) && (vma->vm_end > limit))
>  			limit = vma->vm_end;
>  		spin_unlock(&current->mm->page_table_lock);
> -- 
> 1.7.9.5
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
Stefan Bader - June 6, 2012, 6:56 a.m.
On 05.06.2012 22:29, Herton Ronaldo Krzesinski wrote:
> Since commit 31db58b3 ("mm: arch: make get_gate_vma take an mm_struct
> instead of a task_struct"), that went in linux 2.6.39, get_gate_vma is
> expected to take an struct mm_struct pointer as its parameter. But
> get_gate_vma in i386 NX emulation code patch is still using the old way,
> fix it.
> 
> BugLink: http://bugs.launchpad.net/bugs/1009200
> Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
> ---
>  arch/x86/kernel/traps.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index f463b43..f7c210d 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -142,7 +142,7 @@ check_lazy_exec_limit(int cpu, struct pt_regs *regs, long error_code)
>  		for (vma = current->mm->mmap; vma; vma = vma->vm_next)
>  			if ((vma->vm_flags & VM_EXEC) && (vma->vm_end > limit))
>  				limit = vma->vm_end;
> -		vma = get_gate_vma(current);
> +		vma = get_gate_vma(current->mm);
>  		if (vma && (vma->vm_flags & VM_EXEC) && (vma->vm_end > limit))
>  			limit = vma->vm_end;
>  		spin_unlock(&current->mm->page_table_lock);
Ugh, correct.
Leann Ogasawara - June 6, 2012, 1:31 p.m.
On 06/05/2012 01:29 PM, Herton Ronaldo Krzesinski wrote:
> Since commit 31db58b3 ("mm: arch: make get_gate_vma take an mm_struct
> instead of a task_struct"), that went in linux 2.6.39, get_gate_vma is
> expected to take an struct mm_struct pointer as its parameter. But
> get_gate_vma in i386 NX emulation code patch is still using the old way,
> fix it.
>
> BugLink: http://bugs.launchpad.net/bugs/1009200
> Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>

Looks straightforward and correct.

Acked-by: Leann Ogasawara <leann.ogasawara@canonical.com>

> ---
>  arch/x86/kernel/traps.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index f463b43..f7c210d 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -142,7 +142,7 @@ check_lazy_exec_limit(int cpu, struct pt_regs *regs, long error_code)
>  		for (vma = current->mm->mmap; vma; vma = vma->vm_next)
>  			if ((vma->vm_flags & VM_EXEC) && (vma->vm_end > limit))
>  				limit = vma->vm_end;
> -		vma = get_gate_vma(current);
> +		vma = get_gate_vma(current->mm);
>  		if (vma && (vma->vm_flags & VM_EXEC) && (vma->vm_end > limit))
>  			limit = vma->vm_end;
>  		spin_unlock(&current->mm->page_table_lock);
Herton Ronaldo Krzesinski - June 8, 2012, 1:24 p.m.
Applied to Oneiric/Precise master-next.

Patch

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index f463b43..f7c210d 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -142,7 +142,7 @@  check_lazy_exec_limit(int cpu, struct pt_regs *regs, long error_code)
 		for (vma = current->mm->mmap; vma; vma = vma->vm_next)
 			if ((vma->vm_flags & VM_EXEC) && (vma->vm_end > limit))
 				limit = vma->vm_end;
-		vma = get_gate_vma(current);
+		vma = get_gate_vma(current->mm);
 		if (vma && (vma->vm_flags & VM_EXEC) && (vma->vm_end > limit))
 			limit = vma->vm_end;
 		spin_unlock(&current->mm->page_table_lock);