[PATCH] vt: fix potential race in VT_WAITACTIVE handler
authorMichal Januszewski <spock@gentoo.org>
Mon, 2 Apr 2007 06:49:51 +0000 (23:49 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 2 Apr 2007 17:06:09 +0000 (10:06 -0700)
commitf991519c197534811046e5e47389b6fafcdf1e48
treea8df0ce3aafc97968a354e736305a3fc807f1dea
parent1d64b9cb1dc2a7cd521444e3d908adeccd026356
[PATCH] vt: fix potential race in VT_WAITACTIVE handler

On a multiprocessor machine the VT_WAITACTIVE ioctl call may return 0 if
fg_console has already been updated in redraw_screen() but the console
switch itself hasn't been completed.  Fix this by checking fg_console in
vt_waitactive() with the console sem held.

Signed-off-by: Michal Januszewski <spock@gentoo.org>
Acked-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/vt_ioctl.c