]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] vt: fix possible memory corruption in complement_pos
authorAntonino A. Daplas <adaplas@gmail.com>
Tue, 6 Sep 2005 22:17:52 +0000 (15:17 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 7 Sep 2005 23:57:36 +0000 (16:57 -0700)
commitece7284dbbf2c0ec4e7da9f8662afc14bb53ba97
tree4c4861b54b2c1529c4677e6d31bb6027568aaa1a
parent59c71557a2af85829b46a11a8931d1e7e12be825
[PATCH] vt: fix possible memory corruption in complement_pos

Based on a patch from Andr Pereira de Almeida <andre@cachola.com.br>

It might be possible for the saved pointer (*p) to become invalid in
between vc_resizes, so saving the screen offset instead of the screen
pointer is saner.

This bug is very hard to trigger though, but Andre probably did, if he's
submitting this patch.  Anyway, with Andre's patch, it's still possible for
the offsets to be still illegal, if the new screen size is smaller than the
old one.  So I've also added checks if the offsets are still within the
screenbuffer size.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/vt.c