diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2007-10-16 04:29:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:20 -0400 |
commit | e400b6ec4ede4dc0aa8e5640425df5b29796fe0e (patch) | |
tree | 8fbca730c850fd85fbf0f2d70daef7765ed4cb7f /drivers/usb/misc/sisusbvga | |
parent | 0058f479e52d0c0718c843cb34223bc1bfce36e1 (diff) |
vt/vgacon: Check if screen resize request comes from userspace
Various console drivers are able to resize the screen via the con_resize()
hook. This hook is also visible in userspace via the TIOCWINSZ, VT_RESIZE and
VT_RESIZEX ioctl's. One particular utility, SVGATextMode, expects that
con_resize() of the VGA console will always return success even if the
resulting screen is not compatible with the hardware. However, this
particular behavior of the VGA console, as reported in Kernel Bugzilla Bug
7513, can cause undefined behavior if the user starts with a console size
larger than 80x25.
To work around this problem, add an extra parameter to con_resize(). This
parameter is ignored by drivers except for vgacon. If this parameter is
non-zero, then the resize request came from a VT_RESIZE or VT_RESIZEX ioctl
and vgacon will always return success. If this parameter is zero, vgacon will
return -EINVAL if the requested size is not compatible with the hardware. The
latter is the more correct behavior.
With this change, SVGATextMode should still work correctly while in-kernel and
stty resize calls can expect correct behavior from vgacon.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/misc/sisusbvga')
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb_con.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/misc/sisusbvga/sisusb_con.c b/drivers/usb/misc/sisusbvga/sisusb_con.c index 43722e5a49d1..b624320df903 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_con.c +++ b/drivers/usb/misc/sisusbvga/sisusb_con.c | |||
@@ -1042,7 +1042,8 @@ sisusbcon_set_origin(struct vc_data *c) | |||
1042 | 1042 | ||
1043 | /* Interface routine */ | 1043 | /* Interface routine */ |
1044 | static int | 1044 | static int |
1045 | sisusbcon_resize(struct vc_data *c, unsigned int newcols, unsigned int newrows) | 1045 | sisusbcon_resize(struct vc_data *c, unsigned int newcols, unsigned int newrows, |
1046 | unsigned int user) | ||
1046 | { | 1047 | { |
1047 | struct sisusb_usb_data *sisusb; | 1048 | struct sisusb_usb_data *sisusb; |
1048 | int fh; | 1049 | int fh; |