Re: Local DoS attack on i386

Andre Tomt
2004-06-15T04:34:43Z

Nuno Monteiro wrote:
> The same fix should be applied to 2.4. I'm running locally a very
> hacked version of 2.4.22 with it and it survives that crash.c program.
>
> Here's the diff. Marcelo, please merge.
>
>
> --- linux-2.4.27-pre5/include/asm-i386/i387.h~fix-x86-clear_fpu-macro 2004-06-14 15:12:13.909059344 +0100
> +++ linux-2.4.27-pre5/include/asm-i386/i387.h 2004-06-14 15:12:45.970185312 +0100
> @@ -34,7 +34,7 @@ extern void kernel_fpu_begin(void);
>
> #define clear_fpu( tsk ) do { \
> if ( tsk->flags & PF_USEDFPU ) { \
> - asm volatile("fwait"); \
> + asm volatile("fnclex ; fwait"); \
> tsk->flags &= ~PF_USEDFPU; \
> stts(); \
> } \

You're missing x86-64.

Complete patches are up at <http://tomt.net/kernel/clear_fpu/> - these
covers 2.4 and 2.6, plus i386 and x86-64.

But I guess Marcelo would want the x86-64 part to come through ak.

--
Cheers,
André Tomt