aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mcde
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-08-21 10:24:56 +0300
committerNoralf Trønnes <noralf@tronnes.org>2019-08-26 14:50:55 +0200
commitd72cf01f410aa09868d98b672f3f92328c96b32d (patch)
treea1e21abcd34b9e5d5a47d090cbb9314e303557ed /drivers/gpu/drm/mcde
parentdrm/panel: Initialise panel dev and funcs through drm_panel_init() (diff)
downloadlinux-dev-d72cf01f410aa09868d98b672f3f92328c96b32d.tar.xz
linux-dev-d72cf01f410aa09868d98b672f3f92328c96b32d.zip
drm/mipi-dbi: fix a loop in debugfs code
This code will likely crash if we try to do a zero byte write. The code looks like this: /* strip trailing whitespace */ for (i = count - 1; i > 0; i--) if (isspace(buf[i])) ... We're writing zero bytes so count = 0. You would think that "count - 1" would be negative one, but because "i" is unsigned it is a large positive numer instead. The "i > 0" condition is true and the "buf[i]" access will be out of bounds. The fix is to make "i" signed and now everything works as expected. The upper bound of "count" is capped in __kernel_write() at MAX_RW_COUNT so we don't have to worry about it being higher than INT_MAX. Fixes: 02dd95fe3169 ("drm/tinydrm: Add MIPI DBI support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> [noralf: Adjust title] Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190821072456.GJ26957@mwanda
Diffstat (limited to 'drivers/gpu/drm/mcde')
0 files changed, 0 insertions, 0 deletions