I have made myself a Linux console aware getty program, which allocates and disallocates console ttys on the fly when users login and logout. It exposed a bug ioctl(/dev/console,VT_DISALLOCATE) with SMP machines (or at least, I could reproduce it only in a SMP machine). It turned out, that vc_disallocate() misses spin_lock_irq(&console_lock). It seems that nobody but me actually uses VT_DISALLOCATE.. If you have a SMP machine, you can reproduce the bug and CRASH YOUR KERNEL (so don't do it, if you don't want to crash your kernel) by running the following program as root in /dev/tty1 a few times (assuming you have nothing running in tty11): #include #include #include #include int main() { int console_fd=open("/dev/console",O_WRONLY); int i; for (i=0; i<100; i++) { int ttyfd=open("/dev/tty11",O_WRONLY); write(ttyfd,"blah",5); ioctl(console_fd,VT_ACTIVATE,11); close(ttyfd); ioctl(console_fd,VT_ACTIVATE,1); ioctl(console_fd,VT_DISALLOCATE,11); } } A trivial patch against drivers/char/console.c is included. Please CC your comments to me, since I am not on the list. - Jani