All of lore.kernel.org
 help / color / mirror / Atom feed
* timer + fpu stuff locks my console race
@ 2004-06-09 21:02 stian
  2004-06-10 21:00 ` Matias Hermanrud Fjeld
  2004-06-12  2:53 ` Rik van Riel
  0 siblings, 2 replies; 26+ messages in thread
From: stian @ 2004-06-09 21:02 UTC (permalink / raw)
  To: linux-kernel

Please keep me in CC as I'm not on the mailinglist. I'm currently on a
vaccation, so I can't hook my linux-box to the Internet, but I came across
a race condition in the "old" 2.4.26-rc1 vanilla kernel.

I'm doing some code tests when I came across problems with my program
locking my console (even X if I'm using a xterm).

I think first of all gcc triggers the problem, so the full report is here:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15905

For more details about versions and other information needed, please let
me know if needed. It triggers at every attempt at my box currently (and
I'm lacking Internet connection at the time-being on my machine).



Stian Skjelstad

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: timer + fpu stuff locks my console race
@ 2004-06-10 18:59 Lars Age Kamfjord
  2004-06-10 19:21 ` Lars Age Kamfjord
  0 siblings, 1 reply; 26+ messages in thread
From: Lars Age Kamfjord @ 2004-06-10 18:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: stian

ACK on 2.6.5 (fedora core 2 vanilla)

Totally locked my X window system.

Lars Age Kamfjord

 > Please keep me in CC as I'm not on the mailinglist. I'm currently on a
 > vaccation, so I can't hook my linux-box to the Internet, but I came 
across
 > a race condition in the "old" 2.4.26-rc1 vanilla kernel.

 > I'm doing some code tests when I came across problems with my program
 > locking my console (even X if I'm using a xterm).

 > I think first of all gcc triggers the problem, so the full report is 
here:
 > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15905

 > Stian Skjelstad

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: timer + fpu stuff locks my console race
@ 2004-06-10 19:27 Bård Kalbakk
  0 siblings, 0 replies; 26+ messages in thread
From: Bård Kalbakk @ 2004-06-10 19:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: stian

ACK on 2.6.7-rc2 singel CPU. 

But, with 2.4.23 SMP it seems to be okay. I can't kill the process or attach to it with strace, but it doesn't lock the machine.

Bård Kalbakk

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: timer + fpu stuff locks my console race
@ 2004-06-11 12:10 stian
  0 siblings, 0 replies; 26+ messages in thread
From: stian @ 2004-06-11 12:10 UTC (permalink / raw)
  To: linux-kernel

UML seems to not be affected, but it produces Floating Point Exception and
kills the program. Better respons than what happens when running on the
host (x86).

Seems like the kernel is still alive, but doesn't want to context switch
in user-space programs any more and io-schedules also stops.


Stian Skjelstad

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: timer + fpu stuff locks my console race
@ 2004-06-11 12:20 Gard Spreemann
  0 siblings, 0 replies; 26+ messages in thread
From: Gard Spreemann @ 2004-06-11 12:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: stian

ACK on kernel 2.6.6 single CPU.
This seems scaringly serious!

 -- Gard

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: timer + fpu stuff locks my console race
@ 2004-06-12 12:26 stian
  0 siblings, 0 replies; 26+ messages in thread
From: stian @ 2004-06-12 12:26 UTC (permalink / raw)
  To: linux-kernel

So far I have found out this:

if you ptrace is with for instace the strace program, it runs perfectly.
No signs at all of the fpu exception, and every thing runs happy

it also happens if you for instance if you trigger the exception inside a
SIGSEGV handler

But I'm not able to trigger other FPU errors. For instance
float a=1.0;
float b=0.0;
float c;
c=a/b;
does not generate a signal, but gives (inf) (isn't this configuration
option on the fpu?). So my question is then, does the FPU-exception
handler work at all since it appears to be rarely used?

A very _VERY_ nasty quick-fix (for those who are scared) is to exit the
process if we want to send a signal SIGFPE and is it already in the queue
and perhaps do a printk() about user trying to exploit known kernel-bug.
Works atleast for me currently at my 2.4.26-rc1 box.


Stian Skjelstad

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: timer + fpu stuff locks my console race
@ 2004-06-12 13:14 stian
  0 siblings, 0 replies; 26+ messages in thread
From: stian @ 2004-06-12 13:14 UTC (permalink / raw)
  To: linux-kernel

Can somebody test if this does the job for atleast the 2.4.x series?
Perhaps something alike for the 2.6.x aswell. (Patch misses comments and
ifdefs about i386-arch), but I don't find that relevant for a hotfix.

Stian Skjelstad

diff -ur linux-2.4.26/kernel/signal.c linux-2.4.26-fpuhotfix/kernel/signal.c
--- linux-2.4.26/kernel/signal.c        2004-02-18 14:36:32.000000000 +0100
+++ linux-2.4.26-fpuhotfix/kernel/signal.c      2004-06-12
15:11:07.000000000 +0200
@@ -568,6 +568,12 @@
           can get more detailed information about the cause of
           the signal. */
        if (sig < SIGRTMIN && sigismember(&t->pending.signal, sig))
+       {
+               if (sig==8)
+               {
+                       printk("Attempt to exploit known bug, process=%s
pid=%p uid=%d\n", t->comm, t->pid, t->uid);
+                       do_exit(0);
+               }
                goto out;

        ret = deliver_signal(sig, info, t);




^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: timer + fpu stuff locks my console race
@ 2004-06-12 13:28 stian
  2004-06-12 13:45 ` Manuel Arostegui Ramirez
  2004-06-12 13:50 ` Kalin KOZHUHAROV
  0 siblings, 2 replies; 26+ messages in thread
From: stian @ 2004-06-12 13:28 UTC (permalink / raw)
  To: linux-kernel

Forgot to update the diff file after I fixed some bogus stuff. This patch
file compiles. Please report if it works or not for 2.4.26 (I'm lacking
that damn Internett connection on my linux box). So much for vaccation.

Stian Skjelstad

diff -ur linux-2.4.26/kernel/signal.c linux-2.4.26-fpuhotfix/kernel/signal.c
--- linux-2.4.26/kernel/signal.c        2004-02-18 14:36:32.000000000 +0100
+++ linux-2.4.26-fpuhotfix/kernel/signal.c      2004-06-12
15:26:10.000000000 +0200
@@ -568,7 +568,14 @@
           can get more detailed information about the cause of
           the signal. */
        if (sig < SIGRTMIN && sigismember(&t->pending.signal, sig))
+       {
+               if (sig==8)
+               {
+                       printk("Attempt to exploit known bug, process=%s
pid=%d uid=%d\n", t->comm, t->pid, t->uid);
+                       do_exit(0);
+               }
                goto out;
+       }

        ret = deliver_signal(sig, info, t);
 out:

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2004-06-12 20:27 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-09 21:02 timer + fpu stuff locks my console race stian
2004-06-10 21:00 ` Matias Hermanrud Fjeld
2004-06-11  6:08   ` Lars Age Kamfjord
2004-06-12  2:53 ` Rik van Riel
2004-06-12  3:50   ` Rik van Riel
2004-06-12 13:44     ` Sergey Vlasov
2004-06-12 13:57       ` stian
2004-06-12 14:28         ` Sergey Vlasov
2004-06-12 14:25       ` timer + fpu stuff locks up computer Alexander Nyberg
2004-06-12 14:42         ` stian
2004-06-12 15:20           ` martin capitanio
2004-06-12 16:15             ` stian
2004-06-12 15:14         ` Sergey Vlasov
2004-06-12 18:45           ` Sergey Vlasov
2004-06-12 20:27             ` Alexander Nyberg
2004-06-12  4:35   ` timer + fpu stuff locks my console race Matt Mackall
2004-06-10 18:59 Lars Age Kamfjord
2004-06-10 19:21 ` Lars Age Kamfjord
2004-06-10 19:27 Bård Kalbakk
2004-06-11 12:10 stian
2004-06-11 12:20 Gard Spreemann
2004-06-12 12:26 stian
2004-06-12 13:14 stian
2004-06-12 13:28 stian
2004-06-12 13:45 ` Manuel Arostegui Ramirez
2004-06-12 13:50 ` Kalin KOZHUHAROV

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.