Message ID | 20230306094921.tik5ewne4ft6mfpo@begin (mailing list archive) |
---|---|
State | Mainlined |
Commit | 18365ebf23f3e713e5dd8e295c9a639295250f3c |
Headers | show |
Series | VT: Protect KD_FONT_OP_GET_TALL from unbound access | expand |
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 57a5c23b51d4..3c2ea9c098f7 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -4545,6 +4545,9 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op) int c; unsigned int vpitch = op->op == KD_FONT_OP_GET_TALL ? op->height : 32; + if (vpitch > max_font_height) + return -EINVAL; + if (op->data) { font.data = kvmalloc(max_font_size, GFP_KERNEL); if (!font.data)