]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm: Truncate the buffer object name if the copy from user failed
authorJordan Crouse <jcrouse@codeaurora.org>
Tue, 19 Feb 2019 18:40:19 +0000 (11:40 -0700)
committerRob Clark <robdclark@gmail.com>
Tue, 19 Feb 2019 19:54:08 +0000 (14:54 -0500)
commit6f19fd88691e41de705082d35590e4c132b630d6
tree86a3ec5a53285fa192fd0a6ab8d99ecf4797cb27
parent7508a1ec07094d0bd797583dac70d2e7fb9860bf
drm/msm: Truncate the buffer object name if the copy from user failed

(Resend since there was a compile error that I forgot to commit before sending)

If there is a error while doing a copy_from_user() for MSM_INFO_SET_NAME
make sure to truncate the object name so that there isn't a chance that
we'll have random data in the string.

This is on top of [1] reported and fixed by Dan Carpenter.

[1] https://patchwork.freedesktop.org/series/56656/

Fixes: aa3287591b0b ("drm/msm: add uapi to get/set debug name")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/msm_drv.c