Tetsuo Handa
ffb324e6f8
tty: vt: always invoke vc->vc_sw->con_resize callback
...
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>
2021-05-15 08:12:12 -07:00
..
2021-04-10 10:41:40 +02:00
2021-03-10 09:34:09 +01:00
2020-11-06 10:49:27 +01:00
2021-04-26 15:10:25 -07:00
2021-05-15 08:12:12 -07:00
2021-04-07 17:22:07 +02:00
2020-03-17 23:40:31 +11:00
2020-10-28 13:44:43 +01:00
2021-04-09 17:00:32 +02:00
2021-03-10 09:34:06 +01:00
2020-08-23 17:36:59 -05:00
2021-04-07 17:22:07 +02:00
2020-06-27 16:21:20 +02:00
2021-04-22 12:09:24 +02:00
2021-04-15 10:32:17 +02:00
2021-04-15 10:32:17 +02:00
2021-03-10 09:34:06 +01:00
2021-03-10 09:34:06 +01:00
2021-04-15 10:22:17 +02:00
2021-03-10 09:34:08 +01:00
2021-04-15 10:22:17 +02:00
2021-04-22 12:01:59 +02:00
2021-04-10 10:33:00 +02:00
2021-04-15 10:24:58 +02:00
2021-04-15 10:32:17 +02:00
2021-04-15 10:26:58 +02:00
2021-04-15 10:28:30 +02:00
2021-04-15 10:30:18 +02:00
2021-04-15 10:22:17 +02:00
2021-04-15 10:22:17 +02:00
2021-04-15 10:26:58 +02:00
2021-04-15 10:22:17 +02:00
2021-04-15 10:32:17 +02:00
2021-01-08 11:02:18 -08:00
2021-03-10 09:34:09 +01:00