There exist crash bugs in some of the system call handlers to do with string validation; sometimes, only the first byte of an argument string is validated. The following program reliably causes a kernel panic for me:

#include <u.h>
#include <libc.h>

#define SEGBASE (char*)0x40000000
#define SEGSIZE 4096

int main() {
    segattach(0, "shared", SEGBASE, SEGSIZE);
    *(char*)(SEGBASE + SEGSIZE - 1) = 'a';
    exec((char*)SEGBASE + SEGSIZE - 1, nil);
    return 0;
}

-- Elly

Reply via email to