]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Correct signedness bug in drm_modeset_ctl
authoremaste <emaste@FreeBSD.org>
Thu, 22 Mar 2018 01:00:55 +0000 (01:00 +0000)
committeremaste <emaste@FreeBSD.org>
Thu, 22 Mar 2018 01:00:55 +0000 (01:00 +0000)
commit8c45d0398856241358f1d04d99f708301df6fed5
tree1fac2d284e4a52fc4640477bedee0769a4fa9ffb
parenta6cf8211622dd53f331111d7bb56277eab2aee80
Correct signedness bug in drm_modeset_ctl

drm_modeset_ctl() takes a signed in from userland, does a boundscheck,
and then uses it to index into a structure and write to it.  The
boundscheck only checks upper bound, and never checks for nagative
values.  If the int coming from userland is negative [after conversion]
it will bypass the boundscheck, perform a negative index into an array
and write to it, causing memory corruption.

Note that this is in the "old" drm driver; this issue does not exist
in drm2.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: cem
MFC after: 1 day
Sponsored by: The FreeBSD Foundation
sys/dev/drm/drm_irq.c