Skip to content
This repository was archived by the owner on Jul 3, 2018. It is now read-only.

Commit 7ff0e9a

Browse files
zhaoyuanGerrit - the friendly Code Review server
authored andcommitted
msm: mdss: hdmi: check up-bound of CEC frame size
the spec says the frame size will not be greater than 14, but this have a security hole when somebody sends a message with a size greater than 14. So need check up-boud of the CEC frame size. Change-Id: I743208badc5e77ae911cfb2d102f758d4843138f Signed-off-by: zhaoyuan <[email protected]>
1 parent bf1349b commit 7ff0e9a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/video/msm/mdss/mdss_hdmi_cec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
1+
/* Copyright (c) 2010-2017, The Linux Foundation. All rights reserved.
22
*
33
* This program is free software; you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License version 2 and
@@ -148,7 +148,7 @@ static void hdmi_cec_msg_recv(struct work_struct *work)
148148
msg.sender_id, msg.recvr_id,
149149
msg.frame_size);
150150

151-
if (msg.frame_size < 1) {
151+
if (msg.frame_size < 1 || msg.frame_size > MAX_CEC_FRAME_SIZE) {
152152
DEV_ERR("%s: invalid message (frame length = %d)\n",
153153
__func__, msg.frame_size);
154154
return;
@@ -168,7 +168,7 @@ static void hdmi_cec_msg_recv(struct work_struct *work)
168168
msg.operand[i] = data & 0xFF;
169169
}
170170

171-
for (; i < 14; i++)
171+
for (; i < MAX_OPERAND_SIZE; i++)
172172
msg.operand[i] = 0;
173173

174174
if (cbs && cbs->msg_recv_notify)

0 commit comments

Comments
 (0)