mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
disp: msm: sde: Add change to fix slab out of bounds
Non null terminated string from user space can cause out of bound access issue. Hence added a NULL character explicitly in name when received from user space. Change-Id: I6d498f16a59ec2832ddc0951952101859666eacf Signed-off-by: yadwan <quic_yadwan@quicinc.com> (cherry picked from commit 7eb70ce3648b8eb8e5340b0bf3c5bb3a7605d811)
This commit is contained in:
parent
e5fdc7822b
commit
6bbef66ce3
1 changed files with 2 additions and 0 deletions
|
|
@ -204,6 +204,8 @@ int sde_wb_connector_set_modes(struct sde_wb_device *wb_dev,
|
|||
memset(&dispmode, 0, sizeof(dispmode));
|
||||
ret = drm_mode_convert_umode(wb_dev->drm_dev,
|
||||
&dispmode, &modeinfo[i]);
|
||||
/* null terminate the string */
|
||||
modeinfo[i].name[DRM_DISPLAY_MODE_LEN - 1] = '\0';
|
||||
if (ret) {
|
||||
SDE_ERROR(
|
||||
"failed to convert mode %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x status:%d rc:%d\n",
|
||||
|
|
|
|||
Loading…
Reference in a new issue