]> git.baikalelectronics.ru Git - kernel.git/commit
fbcon: Fix boundary checks for fbcon=vc:n1-n2 parameters
authorHelge Deller <deller@gmx.de>
Thu, 2 Jun 2022 20:06:28 +0000 (22:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:17:22 +0000 (11:17 +0200)
commitc365f1f16c5e3a2ce3c6287eba8004ec67670fde
tree782653314850b643fe810c328ebe4f825a1a8424
parent2dcfc31345d859b004ec9343c72e5ddd49957378
fbcon: Fix boundary checks for fbcon=vc:n1-n2 parameters

commit 93676b8915bfc9f2605ced9cda37b8902a164acb upstream.

The user may use the fbcon=vc:<n1>-<n2> option to tell fbcon to take
over the given range (n1...n2) of consoles. The value for n1 and n2
needs to be a positive number and up to (MAX_NR_CONSOLES - 1).
The given values were not fully checked against those boundaries yet.

To fix the issue, convert first_fb_vc and last_fb_vc to unsigned
integers and check them against the upper boundary, and make sure that
first_fb_vc is smaller than last_fb_vc.

Cc: stable@vger.kernel.org # v4.19+
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/YpkYRMojilrtZIgM@p100
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/video/fbdev/core/fbcon.c