android_kernel_xiaomi_sm8350/drivers/usb/misc/sisusbvga
Antonino A. Daplas e400b6ec4e 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>
2007-10-16 09:43:20 -07:00
..
Kconfig
Makefile
sisusb_con.c vt/vgacon: Check if screen resize request comes from userspace 2007-10-16 09:43:20 -07:00
sisusb_init.c USB: SisUSB2VGA: Lindent drivers/usb/misc/sisusbvga/sisusb_init.c 2007-10-12 14:55:11 -07:00
sisusb_init.h USB: SisUSB2VGA: Lindent drivers/usb/misc/sisusbvga/sisusb_init.h 2007-10-12 14:55:12 -07:00
sisusb_struct.h USB: SisUSB2VGA: Lindent drivers/usb/misc/sisusbvga/sisusb_struct.h 2007-10-12 14:55:13 -07:00
sisusb.c USB: drivers/usb/misc/sisusbvga/sisusb.c: kill two unused variables 2007-10-12 14:55:30 -07:00
sisusb.h USB: SisUSB2VGA: Lindent drivers/usb/misc/sisusbvga/sisusb.h 2007-10-12 14:55:11 -07:00