Snippet to freeze 2.1.125

Ragnar Hojland Espinosa (ragnar@lightside.ddns.org)
Mon, 19 Oct 1998 09:31:16 +0100 (MET)


Could anyone please try to run this and tell me if it freezes their kernel
or not? Compile with gcc 2.7.2.3 and no optimizations

-- 
____/|  Ragnar Hojland  (ragnar@lightside.ddns.org)      Fingerprint  94C4B
\ o.O|                                                   2F0D27DE025BE2302C
 =(_)=  "Thou shalt not follow the NULL pointer for      104B78C56 B72F0822
   U     chaos and madness await thee at its end."       hkp://keys.pgp.com

#include <signal.h>

unsigned char the_data[] = {62, 152, 13, 32, 224, 235, 230, 126, 247 }; void handler (int sig) { }

void (*badboy)(); int main (int argc, char **argv) { badboy = (void(*)())(the_data); signal (SIGSEGV, handler); // asm ("call the_data"); // gcc generates this with -O0 (ok) asm ("movl badboy,%eax"); // and these two with -O1+ (frozen, asm ("call *%eax"); // if you use signal above) return 0; }

/* 0x804952c <the_data>: cwtl 0x804952e <the_data+2>: orl $0xe6ebe020,%eax 0x8049533 <the_data+7>: jle 0x804952c <the_data>

0x8049535 <the_data+9>: addb %al,(%eax) 0x8049537 <the_data+11>: addb %bh,%bh */

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/