]> git.pld-linux.org Git - packages/kernel.git/blob - linux-2.4.20-mxcsr-fix.patch
- security fix for 2.4.x <= 2.4.26
[packages/kernel.git] / linux-2.4.20-mxcsr-fix.patch
1  # (from RH - fixes CAN-2003-0248)
2 --- linux-2.4.20/arch/i386/kernel/i387.c~       2003-05-27 14:10:53.000000000 +0200
3 +++ linux-2.4.20/arch/i386/kernel/i387.c        2003-05-27 14:10:53.000000000 +0200
4 @@ -384,12 +384,14 @@
5  static int restore_i387_fxsave( struct _fpstate *buf )
6  {
7         struct task_struct *tsk = current;
8 +       int err;
9         clear_fpu( tsk );
10 -       if ( __copy_from_user( &tsk->thread.i387.fxsave, &buf->_fxsr_env[0],
11 +       err = __copy_from_user( &tsk->thread.i387.fxsave, &buf->_fxsr_env[0],
12 -                              sizeof(struct i387_fxsave_struct) ) )
13 +                              sizeof(struct i387_fxsave_struct) ) ;
14 -               return 1;
15         /* mxcsr bit 6 and 31-16 must be zero for security reasons */
16         tsk->thread.i387.fxsave.mxcsr &= 0xffbf;
17 +       if (err)
18 +               return 1;
19         return convert_fxsr_from_user( &tsk->thread.i387.fxsave, buf );
20  }
21  
This page took 0.031286 seconds and 3 git commands to generate.