]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r331339: Correct signedness bug in drm_modeset_ctl
authoremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 23 Mar 2018 02:34:45 +0000 (02:34 +0000)
committeremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 23 Mar 2018 02:34:45 +0000 (02:34 +0000)
commit618ebef5b534e882b6e443127a0e56539a692f49
tree34ce2bb111a3549a8a3ed3ce540fb73f4ec4fd7a
parent4d351e34ac20b404bf28a9fa441f5b25233eacde
MFC r331339: 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
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@331410 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/drm/drm_irq.c