Patchwork [Oneiric/SRU] UBUNTU: SAUCE: (no-up) Reinstate missing hunk from nx emulation

login
register
mail settings
Submitter Herton Ronaldo Krzesinski
Date April 5, 2012, 12:15 a.m.
Message ID <1333584949-1361-1-git-send-email-herton.krzesinski@canonical.com>
Download mbox | patch
Permalink /patch/150830/
State New
Headers show

Comments

Herton Ronaldo Krzesinski - April 5, 2012, 12:15 a.m.
From: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>

Recently with kernel 3.0.0-18.31, we started to get several bug reports
of userspace crashes on launchpad, happening on i386 installs. After
reproducing the issue and doing a bisect, we detected that the breakage
started with commit 1d43fea ("i387: do not preload FPU state at task
switch time").

Looking at that commit, turns out that our application of that change
accidentaly removed one piece of i386 NX emulation patch, added with
commit 775e6e8 ("UBUNTU: ubuntu: nx-emu - i386: NX emulation").

This adds back the section of code wrongly removed, verified here it
fixes the bug as well.

BugLink: http://bugs.launchpad.net/bugs/972821
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
 arch/x86/kernel/process_32.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Tim Gardner - April 5, 2012, 2:34 a.m.
Testing on my machine indicates this is the right thing to do.
Stefan Bader - April 5, 2012, 7:16 a.m.
On 05.04.2012 02:15, Herton R. Krzesinski wrote:
> From: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
> 
> Recently with kernel 3.0.0-18.31, we started to get several bug reports
> of userspace crashes on launchpad, happening on i386 installs. After
> reproducing the issue and doing a bisect, we detected that the breakage
> started with commit 1d43fea ("i387: do not preload FPU state at task
> switch time").
> 
> Looking at that commit, turns out that our application of that change
> accidentaly removed one piece of i386 NX emulation patch, added with
> commit 775e6e8 ("UBUNTU: ubuntu: nx-emu - i386: NX emulation").
> 
> This adds back the section of code wrongly removed, verified here it
> fixes the bug as well.
> 
> BugLink: http://bugs.launchpad.net/bugs/972821
> Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
> ---
>  arch/x86/kernel/process_32.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
> index 98f78e8..2d73f7d 100644
> --- a/arch/x86/kernel/process_32.c
> +++ b/arch/x86/kernel/process_32.c
> @@ -307,6 +307,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
>  
>  	fpu = switch_fpu_prepare(prev_p, next_p);
>  
> +	if (next_p->mm)
> +		load_user_cs_desc(cpu, next_p->mm);
> +
>  	/*
>  	 * Reload esp0.
>  	 */
Testing successful and looks to have been in there as described.
Tim Gardner - April 5, 2012, 12:11 p.m.

Patch

diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 98f78e8..2d73f7d 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -307,6 +307,9 @@  __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 
 	fpu = switch_fpu_prepare(prev_p, next_p);
 
+	if (next_p->mm)
+		load_user_cs_desc(cpu, next_p->mm);
+
 	/*
 	 * Reload esp0.
 	 */