bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] i386/i386/fpu.c: check machine state before setting fp_v


From: Samuel Thibault
Subject: Re: [PATCH 2/2] i386/i386/fpu.c: check machine state before setting fp_valid
Date: Sun, 17 Nov 2013 13:03:03 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Marin Ramesa, le Sun 17 Nov 2013 07:01:26 +0100, a écrit :
> When fp_thread is not NULL and is not the current thread, and fp_save() does
> not alter the machine state, check if ifps is NULL before setting fp_valid
> to avoid dereference of null pointer. 

A thread can not be stored in fp_thread but not have ifps != NULL.

> * i386/i386/fpu.c (ifps): Check if it's NULL.
> 
> ---
>  i386/i386/fpu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
> index fb2c8ce..226f4ea 100644
> --- a/i386/i386/fpu.c
> +++ b/i386/i386/fpu.c
> @@ -640,7 +640,8 @@ fphandleerr()
>            */
>           clear_ts();
>           fp_save(fp_thread);
> -         fp_thread->pcb->ims.ifps->fp_valid = 2;
> +         if (fp_thread->pcb->ims.ifps != NULL)       
> +             fp_thread->pcb->ims.ifps->fp_valid = 2;
>           fninit();
>           clear_fpu();
>           /* leave fp_intr_thread THREAD_NULL */
> -- 
> 1.8.1.4
> 
> 

-- 
Samuel
 La carte réseau fournie par cybercable (sn2000) ne va-t-elle que sur
 bus isa ou peut-on aussi la mettre sur bus PCI.
 Merci de m'éclairer.
 -+- JP in le Neuneu Pète un Câble : Une carte dans chaque port -+-



reply via email to

[Prev in Thread] Current Thread [Next in Thread]