Tetsuo Handa
51a17f52f2
tty: vt: always invoke vc->vc_sw->con_resize callback
...
commit ffb324e6f874121f7dce5bdae5e05d02baae7269 upstream.
syzbot is reporting OOB write at vga16fb_imageblit() [1], for
resize_screen() from ioctl(VT_RESIZE) returns 0 without checking whether
requested rows/columns fit the amount of memory reserved for the graphical
screen if current mode is KD_GRAPHICS.
----------
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/kd.h>
#include <linux/vt.h>
int main(int argc, char *argv[])
{
const int fd = open("/dev/char/4:1", O_RDWR);
struct vt_sizes vt = { 0x4100, 2 };
ioctl(fd, KDSETMODE, KD_GRAPHICS);
ioctl(fd, VT_RESIZE, &vt);
ioctl(fd, KDSETMODE, KD_TEXT);
return 0;
}
----------
Allow framebuffer drivers to return -EINVAL, by moving vc->vc_mode !=
KD_GRAPHICS check from resize_screen() to fbcon_resize().
Link: https://syzkaller.appspot.com/bug?extid=1f29e126cf461c4de3b3 [1]
Reported-by: syzbot <syzbot+1f29e126cf461c4de3b3@syzkaller.appspotmail.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: syzbot <syzbot+1f29e126cf461c4de3b3@syzkaller.appspotmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-26 11:29:09 +02:00
..
2020-10-29 09:05:35 +01:00
2020-10-29 09:05:45 +01:00
2021-05-22 10:40:22 +02:00
2021-05-26 11:29:09 +02:00
2020-04-24 07:59:15 +02:00
2019-04-17 08:36:44 +02:00
2020-06-30 15:38:26 -04:00
2019-12-21 10:41:25 +01:00
2019-12-21 10:41:25 +01:00
2019-12-21 10:41:25 +01:00
2020-10-29 09:05:35 +01:00
2020-05-02 17:23:12 +02:00
2020-02-28 15:42:32 +01:00
2020-02-28 15:42:32 +01:00
2020-03-11 07:53:04 +01:00
2019-04-05 22:29:13 +02:00
2021-05-22 10:40:24 +02:00
2018-11-21 09:26:00 +01:00
2019-12-21 10:41:25 +01:00
2019-08-25 10:51:35 +02:00
2020-01-14 20:04:30 +01:00